.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

.Net call or lisp entget

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
StormyC
642 Views, 5 Replies

.Net call or lisp entget

I do not have time to write code to discover which is faster so I wondered if anyone knew.....

 

Task: To obtain the Handle to an entity as a string to be used in legacy lisp routines.

 

Which is likely to be faster;

 

(cdr(assoc 5(entget eName)))

 

OR

 

A call to a .net DLL that returns the handle of the entity eName.

 

Opinions anyone?

5 REPLIES 5
Message 2 of 6
chiefbraincloud
in reply to: StormyC

Use the LSP.  If all you need is a Handle, it would be silly to have to load a .dll to replace 3 lsp function calls.

Dave O.                                                                  Sig-Logos32.png
Message 3 of 6
StormyC
in reply to: chiefbraincloud

Agree, however, I already load a .net DLL that replaces other legacy routines - so the loading of the DLL isnt an issue.

 

Obtaining a handle occurs hundreds of times - so - question still stands... Lisp or .Net. =D

 

....can't rewrite all of the lisp routines in .net yet because of time constraints.

Message 4 of 6
chiefbraincloud
in reply to: StormyC

I still say, for this case, use the LSP.  For routines that you are converting from LSP to .NET, I would go ahead and convert them completely to use all .NET and no LSP, but for the particular case you presented, I do not think there would be a benefit to a .NET function to return the handle as a string.  On the contrary, I think it would result in more CPU instructions and memory read/writes rather than less.

 

Dave O.                                                                  Sig-Logos32.png
Message 5 of 6
dgorsman
in reply to: StormyC

The previous answer still stands 🙂  A couple of hundred calls to extracting a handle from an (entget...) list?  That won't get any faster with .NET.  If speed is critical and you keep pulling the same handles, then consider some optimization such as caching the handle values alongside the entity codes in a list of dotted pairs e.g. (<Ecode> . "Handle").

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
"I don't know" is the beginning of knowledge, not the end.


Message 6 of 6
StormyC
in reply to: dgorsman

Thanks for the responses guys, very much appreciated.

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost