.NET

.NET

Reply
Distinguished Contributor
jmaeding
Posts: 1,046
Registered: ‎12-27-2006
Message 1 of 8 (219 Views)

two drawings open, netloaded assy only works in one...

219 Views, 7 Replies
06-20-2012 04:14 PM

I open a blank 2012 session with drawing1.dwg, then I open a new dwg "drawing2.dwg.

So one session, two blank drawings.

I netload an assy into drawing2, and can run a lispfunction from it.

I netload the the assy into drawing 1, and cannot run the lispfunction.

 

it says "error: no function definition:..."

 

How should the checking process normally be done, to see if a .net dll is loaded?

I normally do this with lisp:

(if (not mylispfunctionname)

  (progn

    (COMMAND "NETLOAD" DLLNAME)

    (vl-arx-import 'AcXt-GetColorNoBylayer) ;since I compile to separate namespace vlx's

  )

)

 

The separate namespace thing is secondary, and I am just talking about loading dll's by hand, and running functions from them on command line.

Once I get that ironed out, I can tackle how to detect from inside a vlx.

 

I saw Kean's post on making a dll to detect what dll's are loaded, but its not even working for me once I have that info.

thx

internal protected virtual unsafe Human()
http://onesmallstepforcad.com/

Moderator
Alexander.Rivilis
Posts: 1,450
Registered: ‎04-09-2008
Message 2 of 8 (206 Views)

Re: two drawings open, netloaded assy only works in one...

06-20-2012 09:34 PM in reply to: jmaeding

The only way - to load dll before the opening of the drawings (for example, demandload from registry). Otherwise, the function with the attribute "lispfunction" only works in drawing, which was current in moment of NETLOAD.


Пожалуйста не забывайте про Утвердить в качестве решения! Утвердить в качестве решения и Give Kudos!Баллы
Please remember to Accept Solution! Accept as Solution and Give Kudos!Kudos

Distinguished Contributor
jmaeding
Posts: 1,046
Registered: ‎12-27-2006
Message 3 of 8 (186 Views)

Re: two drawings open, netloaded assy only works in one...

06-21-2012 11:05 AM in reply to: Alexander.Rivilis

wow, so its just lispfunctions that behave that way.

that is so unexpected, as .net commands are available to all dwgs once the dll is loaded.

 

Its also unexpected that drawings opened after the dll is loaded DO have the lispfunctions available.

If that is possible, why so hard (or why is it not automatic) to load into drawings already open?

 

Note that the pratical implications of this are not too bad, you just tell the user to reopen the drawing, you do not have to close the session and reopen it.

thanks a bunch for your help Alexander, it would take me much more time to see these patterns without your posts!

 

internal protected virtual unsafe Human()
http://onesmallstepforcad.com/

Moderator
Alexander.Rivilis
Posts: 1,450
Registered: ‎04-09-2008
Message 4 of 8 (179 Views)

Re: two drawings open, netloaded assy only works in one...

06-21-2012 12:31 PM in reply to: jmaeding

I've posted that behavior to ADN DevHelp Online some years ago. With AutoCAD 2013 I've not found that bug.


Пожалуйста не забывайте про Утвердить в качестве решения! Утвердить в качестве решения и Give Kudos!Баллы
Please remember to Accept Solution! Accept as Solution and Give Kudos!Kudos

Distinguished Contributor
jmaeding
Posts: 1,046
Registered: ‎12-27-2006
Message 5 of 8 (171 Views)

Re: two drawings open, netloaded assy only works in one...

06-21-2012 01:09 PM in reply to: Alexander.Rivilis

good tip.

I just searched devhelp site for keyword lispfunction and did not see your post.

I wonder how many other good articles are missing....

internal protected virtual unsafe Human()
http://onesmallstepforcad.com/

Moderator
Alexander.Rivilis
Posts: 1,450
Registered: ‎04-09-2008
Message 6 of 8 (168 Views)

Re: two drawings open, netloaded assy only works in one...

06-21-2012 01:21 PM in reply to: jmaeding

:smileyhappy: You do not understand me correctly. I'm not a member of Developer Technical Services (DevTech) team, who are employees of Autodesk.
I am an ordinary member of the ADN (not employee of Autodesk), and as a member of the ADN I can ask questions and report bugs in the API directly to DevTech
team.



Пожалуйста не забывайте про Утвердить в качестве решения! Утвердить в качестве решения и Give Kudos!Баллы
Please remember to Accept Solution! Accept as Solution and Give Kudos!Kudos

Distinguished Contributor
jmaeding
Posts: 1,046
Registered: ‎12-27-2006
Message 7 of 8 (161 Views)

Re: two drawings open, netloaded assy only works in one...

06-21-2012 02:03 PM in reply to: Alexander.Rivilis

I must have implied that, but was actually just thinking you were an ADN member like me, and one of your help requests got turned into an article.

 

Let's say I did not want to have to use reals for any 1st element items in my lists.

The only alternative is serializing/deserializing the list right?

 

I wish I understood the reason the lists are viewed as entity info by default, even though there is no reason to assume that.

internal protected virtual unsafe Human()
http://onesmallstepforcad.com/

Moderator
Alexander.Rivilis
Posts: 1,450
Registered: ‎04-09-2008
Message 8 of 8 (144 Views)

Re: two drawings open, netloaded assy only works in one...

06-21-2012 09:35 PM in reply to: jmaeding

jmaeding wrote:
[...]The only alternative is serializing/deserializing the list right?[...]

I'm not sure this is the only alternative. But it have the right to exist.


Пожалуйста не забывайте про Утвердить в качестве решения! Утвердить в качестве решения и Give Kudos!Баллы
Please remember to Accept Solution! Accept as Solution and Give Kudos!Kudos

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.