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

AutoLISP Osnap function (2016)

9 REPLIES 9
Reply
Message 1 of 10
DennisWabq
1683 Views, 9 Replies

AutoLISP Osnap function (2016)

After migrating to 2016 AutoCAD from 2014 some of my old AutoLISP functions failed.  After hours of trial-and-error debugging I found the Osnap function entity identifiers have changed and some of the old ones (QUI specifically) cause the function to fail.  As this function is usually deeply buried in low-level routines for user input (without error handling, my bad) it was especially hard to find.

 

I looked through the changes to commands and system variables but didn't see this one.  The on-line Help for AutoLISP functions doesn't list the valid identifiers - the in-app Help does, if you keep checking the related references at the bottom.  I don't even remember what QUI was for (Quit?) - quadrant is QUA.  This function shouldn't Fail just because it doesn't like one of the arguments in the string!

 

Valid codes are: END, MID,CEN,GCE,NOD,QUA,INT,EXT,INS,PER,TAN,NEA,APP,PAR, and NON (for none).

 

Hope this helps someone.

Now I need to find out what the ._ command prefix does.  Some code examples have it and others don't and I haven't found it's explanation.  None of my calls have it and seem to work OK.

9 REPLIES 9
Message 2 of 10
paullimapa
in reply to: DennisWabq

The _ underscore prefix invokes AutoCAD's native English command name.

The . period prefix invokes the original AutoCAD command in case it's redefined.

 

PS: Doing a google search you'll find this has been answered many times:

https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/significance-of-before-a-command-nam...

http://www.cadtutor.net/forum/showthread.php?86056-By-putting-underscore-quot-_-quot-or-dash-quot-qu...

 

 

Area Object Link | Attribute Modifier | Dwg Setup | Feet-Inch Calculator
Layer Apps | List on Steroids | VP Zoom Scales | Exchange App Store


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
Message 3 of 10

 

Re the underscore prefix: running the original English version is what it claims to do, but I'd recommend some caution trusting that.

 

I had one bad experience - trying to install a largish (about 50000 lines) Lisp program, written religiously using ._ prefixes - onto an Italian-language AutoCAD Mechanical 2009. After hitting the twentieth command which didn't work I gave up. Even if the command name worked, the parameter names didn't.

 

-- 

 

Message 4 of 10
DennisWabq
in reply to: DennisWabq

Thank you!    One less thing I don't know.

Message 5 of 10


@Anonymous wrote:

 

Re the underscore prefix: running the original English version is what it claims to do, but I'd recommend some caution trusting that.

 

I had one bad experience - ... using ._ prefixes - onto an Italian-language AutoCAD ....


Maybe I'm misunderstanding what you're describing, but I wouldn't expect it to work if what you did was to add underscore prefixes to Italian command and option names.  I believe it's adding them before the English terms that allows code written in English to run in other-than-English-language versions of AutoCAD, without needing to change all those terms to the other language's wording.

Kent Cooper, AIA
Message 6 of 10
Kent1Cooper
in reply to: DennisWabq


@Anonymous wrote:

....  I don't even remember what QUI was for (Quit?) ....


QUI was for QUICK.  The idea was that if you combined it with some other mode, such as if you put QUI,END in, and picked on some location, it would grab onto the first ENDpoint that it found, and wouldn't take the time to evaluate possible multiple ENDpoints within the Aperture box, to determine which was closest to the pick point.  You would use it when you were sure it would find the place you wanted that way, i.e. when you were going to pick at a place without any Osnap ambiguity.  It may have mattered somewhat back when computers were much slower than they are today, but even then I never really used the QUI mode.  If it's no longer supported, it's probably because of the vast increases in processing speed since then -- you would probably never notice the difference.

Kent Cooper, AIA
Message 7 of 10
DennisWabq
in reply to: Kent1Cooper

Great  Thank you  I didn't take time to dust off the old books and look it up.

Interesting that QUI causes the function to fail now.

Message 8 of 10

 

Yes, you misunderstood it. The program was written in the English version of AutoCAD, I was trying to transfer it to our Italian factory.

So, we had to tell them to install the English version for this application.

 

-- 

 

Message 9 of 10
Anonymous
in reply to: DennisWabq

I just spent about 4 hours realizing this new fact while updating some lisp for 2017 products... I know, slow, but it'd help if autodesk had some out of the box lisp reference that would go as deep as you needed.  Maybe like a reference book with the software.  Oh, that was R14.

 

Thanks for the tedious confirmation, though.

Message 10 of 10
john.uhden
in reply to: Kent1Cooper

I think I went through this before, just recently.  The value of quick to me had nothing to do with processing speed.  Instead, it helped me to select the end (whatever) of the newest entity in the pick area.  When you've got a drawing full of contours and pipes and stuff, and you're working on the proposed layout or grading, you always wanted to snap to the most recently created entity.  There's no point to inserting a manhole at the endpoint of a contour or right-of-way line.

 

Now if Autodesk got rid of the option because quick is permanently built in, then fine.  Otherwise I will remain quite upset (actually only if I ever get back to work somewhere).  Guess it won't make any difference if I'm just stocking shelves or driving for Uber.

John F. Uhden

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

Post to forums  

State of Sustainability Webinar


AutoCAD Inside the Factory