Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

2010 has broken my code...

10 REPLIES 10
Reply
Message 1 of 11
FT398
605 Views, 10 Replies

2010 has broken my code...

I've just discovered a bit of an issue on my machine. I'm running AutoCAD 2009 and thus far everything has worked just fine but a couple of days ago I installed Navisworks 2010 and it's stopped a section of code working and I'm at a loss as to how to resolve it.

The point of failure is where I issue a vla-get-ObjectName command as I get an 'ActiveX Server returned an error: Element not found' error.

I have just had a trawl about on the board and tried a few pieces of code which do the same task (extracting attribute info from a block nested in an xref) but they all fail on any machine which has this 2009/2010 combination in place. Any machine with just AutoCAD 2009 on runs the code with no problems.

Is anybody able to offer a solution to get past this problem?
10 REPLIES 10
Message 2 of 11
Anonymous
in reply to: FT398

Add this (vl-load-com) near the begining of the routine. It needs to be called at
least once during each 2010 session.

Joe Burke
Message 3 of 11
FT398
in reply to: FT398

Joe,



I've already got vl loaded - that is most definitely not the issue here as all other vl calls are working as expected. It's once I get to this line of code that it falls down.



If I use this code in a drawing containing an xref called 'MyXref' in a 2009 only machine



(setq BlkCol (vla-get-Blocks (vla-get-ActiveDocument (vlax-get-Acad-Object))))

(setq BlkObj (vla-Item BlkCol "MyXref"))



I get the following output...

#<VLA-OBJECT IAcadBlock 000000003b3741f8>




Whereas if I use the same commands on the exact same drawing in AutoCAD 2009 but with Navisworks 2010 also installed I get this output...

#<VLA-OBJECT 195d9b64>




You will notice the lack of an actual objectname (IAcadBlock) in the second example and I assume this is the source of the ActiveX error when it tells me the element is not found.
Message 4 of 11
FT398
in reply to: FT398

As a further example, using the routine set out in this post (suitably altered to work with my xref/block)



http://discussion.autodesk.com/forums/thread.jspa?messageID=6126219窋




returns...



bad argument type: VLA-object collection: #<VLA-OBJECT 19565f84>
Message 5 of 11
Anonymous
in reply to: FT398

Sorry, I don't know what's going on.
Message 6 of 11
Anonymous
in reply to: FT398


pERHAPS YOU WILL NEED TO RUN A REPAIR ON THE 2009 INSTALL.
crud....sorry 'bout the caps....I just tested some things similar to yours here
and they work fine. I have both Civil3D2009 &
2010 installed.

 

Jeff


style="BORDER-LEFT: #000000 2px solid; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px">
As
a further example, using the routine set out in this post (suitably altered to
work with my xref/block)




href="http://discussion.autodesk.com/forums/thread.jspa?messageID=6126219%EF%BF%BD"
target=_ne...
http://discussion.autodesk.com/forums/thread.jspa?messageID=6126219?




returns...



bad
argument type: VLA-object collection: #<VLA-OBJECT
19565f84>
Message 7 of 11
MICHAELGreisen
in reply to: FT398

I also have the same problem. It affects some of my LSP routines and (most annoyingly) the burst command.

We have also recently installed Navisworks.

Already done a repair for other problems and this one persists.

Any ideas appreciated.
Message 8 of 11
TShoe
in reply to: FT398

Good Afternoon,

I was just checking to see if anyone has found a fix for this. I also am having this problem with the burst command.
Message 9 of 11
Anonymous
in reply to: FT398

On 5/27/2010 2:04 PM, rangermonk wrote:
> Good Afternoon,
>
> I was just checking to see if anyone has found a fix for this. I also am having this problem with the burst command.

Code for what? Burst is an Express tool - did you install Express?
Message 10 of 11
TShoe
in reply to: Anonymous

No, a fix for some ACAD commands not working after installing Navisworks 2010.

Message 11 of 11
dongrout
in reply to: FT398

Hey Mr. Nick,

 

Did you get an answer? I am using AutoCAD 2008 and NavisWorks 2009. Then I installed NavisWorks 2010 and the following code broke.

 

(vlax-for x (vla-get-Blocks (vla-get-ActiveDocument (vlax-get-Acad-Object))) (print x))

 

suppose to print: #<VLA-OBJECT IAcadModelSpace2 06d49bd4> #<VLA-OBJECT IAcadPaperSpace2 06d49864> etc.

now prints: #<VLA-OBJECT 07e0110c> #<VLA-OBJECT 07e0115c> etc.

 

I'm going to uninstall NavisWorks 2010 to see if that fixes things.

 

Don

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost