Visual LISP, AutoLISP and General Customization

Reply
Valued Contributor
FT398
Posts: 93
Registered: ‎03-09-2003
Message 1 of 11 (475 Views)

2010 has broken my code...

475 Views, 10 Replies
04-27-2009 02:21 AM
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?
*Joe Burke
Message 2 of 11 (475 Views)

Re: 2010 has broken my code...

04-27-2009 03:44 AM 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
Valued Contributor
FT398
Posts: 93
Registered: ‎03-09-2003
Message 3 of 11 (475 Views)

Re: 2010 has broken my code...

04-27-2009 04:03 AM 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.
Valued Contributor
FT398
Posts: 93
Registered: ‎03-09-2003
Message 4 of 11 (475 Views)

Re: 2010 has broken my code...

04-27-2009 06:11 AM 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>
*Joe Burke
Message 5 of 11 (475 Views)

Re: 2010 has broken my code...

04-27-2009 01:59 PM in reply to: FT398
Sorry, I don't know what's going on.
*Jeff Mishler
Message 6 of 11 (475 Views)

Re: 2010 has broken my code...

04-27-2009 04:45 PM 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>
Active Member
MICHAELGreisen
Posts: 9
Registered: ‎07-28-2009
Message 7 of 11 (475 Views)

Re: 2010 has broken my code...

07-28-2009 03:24 PM 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.
Contributor
rangermonk
Posts: 11
Registered: ‎05-27-2009
Message 8 of 11 (475 Views)

Re: 2010 has broken my code...

05-27-2010 12:04 PM 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.
*None
Message 9 of 11 (476 Views)

Re: 2010 has broken my code...

05-27-2010 02:25 PM 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?
Contributor
rangermonk
Posts: 11
Registered: ‎05-27-2009
Message 10 of 11 (471 Views)

Re: 2010 has broken my code...

06-10-2010 05:52 AM in reply to: *None

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

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community