PDA

View Full Version : EaglePoint Excel Conflict


CAB2k
2006-12-07, 06:10 PM
Perhaps someone familiar with using Excel can shed some light on a problem.

Using Peter's "ExceltoList" to Open & read an Excel spread sheet there is some sort of conflict with EaglePoing Civil.
My lisp runs at the end of the drawing "Open" process to check & update a text table in the drawing.
To do so I use Peters routine to read the Excel data. This works fine starting ACAD without EaglePoint.
But if you are in EaglePoint & it starts ACAD to open the drawing the Excel Open fails.

Thank you Peter the routine is very nice. source http://forums.augi.com/showthread.php?t=49772

Below is the command line echo during the process.
Note: some information is X'ed out for privacy reasons.

This is the Failed Start while starting from EaglePoint and the routine running successfully from the command line once the drawing is open.
Opening an AutoCAD 2007 format file.
Resolve Xref "XXXX": XXXXX.dwg
Resolve Xref "XXXX": XXXXX.DWG
Regenerating layout.
Regenerating model.
Done

AutoCAD Express Tools Copyright © 2002-2004 Autodesk, Inc.

AutoCAD menu utilities loaded.Regenerating layout.

Regenerating model.

>>>---> Reading Excel, Please wait.
*** Looking for Excel file. ***
*** Excel file found. ***
*** System Drive = C:
*** Looking for Excel.exe
*** Excel.exe found. ***
C:\Program Files\Microsoft Office\Office11\XL5EN32.OLB
*** Importing Excel type library. ***
*** Opening Excel -> \\q.xls
nil
*** Excel failed to open spread sheet. ***
*** Releasing Objects. ***
*** ERROR reading xl file. ***
"Hello XXXX" regenall Regenerating layout.

Regenerating model.

"E.lsp loaded successfully"

Autodesk DWG. This file is a Trusted DWG last saved by an Autodesk application or Autodesk licensed application.

<--------<<< DRAWING IS OPEN
<--------<<< USER AT THE COMMAND LINE

Command:

Command: BuildTable

>>>---> Reading Excel, Please wait.

*** Looking for Excel file. ***
*** Excel file found. ***
*** Opening Excel -> q.xls
#<VLA-OBJECT _Application 0f53bc34>
#<VLA-OBJECT Workbooks 0f53be0c>
#<VLA-OBJECT _Workbook 0f53907c>
#<VLA-OBJECT Sheets 0f5392d4>
#<VLA-OBJECT _Worksheet 0f611ca4>
:vlax-true
*** Reading spreadsheet data. ***
*** Releasing Objects. ***
>>>---> Building table, Plesae wait.
Redefining block "MyBlock"
*** Excel Read routine complete. ***


This is the echo of starting ACAD without EaglePoint and the routine runs successfully at the start up.
Note: some reporting was turned off in this output.

[ AutoCAD - Tue Dec 05 16:53:57 2006 ]----------------------------------------
Opening an AutoCAD 2007 format file.
Resolve Xref "xxxx": xxxxx.dwg
Resolve Xref "xxxx": xxxxxx.DWG
Regenerating layout.
Regenerating model.
Done

AutoCAD Express Tools Copyright © 2002-2004 Autodesk, Inc.
AutoCAD menu utilities loaded.Regenerating layout.
Regenerating model.

Layer "Viewport" already exists.

>>>---> Reading Excel, Please wait.
C:\Program Files\Microsoft Office\Office11\XL5EN32.OLB
>>>---> Building table, Plesae wait.
Redefining block "MyBlock"
"Hello xxxxxx" regenall Regenerating layout.
Regenerating model.
"E.lsp loaded successfully"
Autodesk DWG. This file is a Trusted DWG last saved by an Autodesk application or Autodesk licensed application.

Command:

Opie
2006-12-07, 07:19 PM
Which version of Eagle Point are you using?

Have you tried changing the strPrefix for the ImportLibrary function to a different name? I don't think that will fix it, but you never know.

miff
2006-12-07, 07:51 PM
From the failed output:
*** Opening Excel -> \\q.xls

From the successful output:
*** Opening Excel -> q.xls

Why/How is the first one getting the backslashes?

I suspect that this code is running prior to E.P.'s startup functions. I don't have E.P., but I do have LDT which also loads a ton of stuff. Here's the output at startup with the EndOpen Event performing only 1 task.....outputting to the command line: "...Checking for LDD...". Note that this comes BEFORE the LDT stuff being initialized.


Regenerating model.

Command: ...Checking for LDD...
Command:
AutoCAD Express Tools Copyright © 2000 Autodesk, Inc.

AutoCAD menu utilities loaded.Press ENTER to continue:
Initializing...
Loading AecCivilCogo...
Loading AecCivilDraft...Press ENTER to continue:
Loading AecTreeMgrAcad...
Loading AecSurfaceMgr...
Loading AecCivilDtm...

Loading AecCivilAln...
Command:


HTH,
Jeff

CAB2k
2006-12-07, 08:04 PM
Sorry Jeff, that was me editing out data I did not want to share. Just did not edit the lines the same. :(

Using Eagle Point Version 2006, but I don't have ether so testing is via a second party.

I tried S::STARTUP to push the routine to the end of the Open but that too failed.

peter
2006-12-07, 08:41 PM
Maybe try a reactor

:VLR-documentBecameCurrent

Peter

CAB2k
2006-12-07, 10:17 PM
Thanks Peter, that's where i was headed next.
Trouble is it will be my first reactor. Thanks for the head start though.

ccowgill
2006-12-08, 05:41 PM
when using this code:

;; Set up the Reactor
(if (= (type Quan_Table_Reactor) 'vlr-dwg-reactor)
(if (not (vlr-added-p Quan_Table_Reactor))
(vlr-add Quan_Table_Reactor)
)
(setq Quan_Table_Reactor
(vlr-docmanager-reactor
nil
'((:vlr-documentToBeActivated . axl2qt-rea))
)
)
)
;; call back function
(defun axl2qt-rea (reactor callbackData)
(if c:axl2qt
(c:axl2qt) ; call the routine to build the table.
(print "*** Excel Table Reader not loaded ***")
)
(print "*** Reactor Fired ***")
;; disable the reactor, only used first time in DWG
(vlr-remove Quan_Table_Reactor)
(princ)
)

It runs fine when vanilla AutoCAD is used to open a drawing, however when Eagle Point does what ever it does to open a file, I get this error:

Command: ; error: invalid AutoCAD command: nil
any suggestions on that?