Rooster Posted January 14, 2009 Share Posted January 14, 2009 Is it possible to do anything to my very simple LISP (below) that just turns on the snaps that I use most frequently that will allow me to use the LISP within an active command? For example, if the only snap I currently have on is INSERTION POINT and I'm in the middle of a POLYLINE command and want to snap to ENDPOINTS or MIDPOINTS, is there a way to edit my LISP so that it will allow me to keep the POLYLINE command active, turn on the snaps that I want, and then carry on POLYLINING?? (Just like you can do with F3) At the moment if I try to use my LISP within another command it just exits the current command and I have to start over again. Here's my LISP: ;LISP TO TURN ON NORMAL SNAP SETTINGS (ENDPOINT, MIDPOINT, CENTER, INSERTION, INTERSECTION) (DEFUN C:NORMSNAP (/ ) (SETVAR "OSMODE" 103) (PROMPT "\nACTIVE SNAPS:ENDPOINT/MIDPOINT/CENTRE/INSERTION/INTERSECTION") (PRINC) ) Quote Link to comment Share on other sites More sharing options...
David Bethel Posted January 14, 2009 Share Posted January 14, 2009 Rooster, In short 'No'. Auotlisp commands cannot be transparent. Have you looked into Button section of the menus. At least that's what they used to be called. They can be transparent Attached is my middle button ( wheel ) options from R14. -David Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted January 14, 2009 Share Posted January 14, 2009 Some crazy colour schemes going on there... Quote Link to comment Share on other sites More sharing options...
Rooster Posted January 14, 2009 Author Share Posted January 14, 2009 Rooster, In short 'No'. Auotlisp commands cannot be transparent. Thanks David. Shame about that. Yes, I am aware of the button menus which I do also use. But I guess the best way is to just remember to change my snaps before beginning a new command! Quote Link to comment Share on other sites More sharing options...
eldon Posted January 14, 2009 Share Posted January 14, 2009 If you assign your most used snaps to the F keys, then you can select any of them with one key press when you are in the middle of a command. The advantage of this is that the cursor does not have to be moved from the scene of action Quote Link to comment Share on other sites More sharing options...
Jaelin Posted January 14, 2009 Share Posted January 14, 2009 If you assign your most used snaps to the F keys, then you can select any of them with one key press when you are in the middle of a command. The advantage of this is that the cursor does not have to be moved from the scene of action Thats a cool idea. Never thought of that one before. Quote Link to comment Share on other sites More sharing options...
StevJ Posted January 14, 2009 Share Posted January 14, 2009 This works for me (AutoCAD 2006): While you're drawing that polyline, SHIFT-RIGHT-click or CTRL-right-click. The list you see is for changing the snap for the next point only. That's not exactly what you want, so... Select Osnap Settings at the bottom of the list. Make your changes, then click on OK. You will be returned to your polyline with the new snap settings active. Steve Quote Link to comment Share on other sites More sharing options...
lpseifert Posted January 14, 2009 Share Posted January 14, 2009 use your Normsnap transparently ['normsnap] during a command; needs to be loaded first Quote Link to comment Share on other sites More sharing options...
CarlB Posted January 14, 2009 Share Posted January 14, 2009 As lpseifert says it can be used transparently, just need to preceded it with the apostrophe. You might want to shorten the name, and remove the prompt for ease of use & avoid an error message when using it. Quote Link to comment Share on other sites More sharing options...
David Bethel Posted January 14, 2009 Share Posted January 14, 2009 use your Normsnap transparently ['normsnap] during a command; needs to be loaded first ? When did that change? It was always a wish list item, but I never heard that it had been accomplished. -David Quote Link to comment Share on other sites More sharing options...
ASMI Posted January 14, 2009 Share Posted January 14, 2009 With autolisp is possible to create transperent command if you use vlax-add-cmd function with ACRX_CMD_TRANSPARENT flag. Try: (defun tt() (alert "I am transperent lisp command ") (princ) ); end of c:trp (vl-load-com) (vlax-add-cmd "tt" 'tt "tt" ACRX_CMD_TRANSPARENT) Now you can invoke 'tt command within any autocad command. For example: Command: pline Specify start point: Current line-width is 0.0000 Specify next point or [Arc/Halfwidth/Length/Undo/Width]: Specify next point or [Arc/Close/Halfwidth/Length/Undo/Width]: [b][color="Blue"]'tt[/color][/b] [color="#0000ff"][b]Resuming PLINE command.[/b][/color] Specify next point or [Arc/Close/Halfwidth/Length/Undo/Width]: Specify next point or [Arc/Close/Halfwidth/Length/Undo/Width]: Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted January 14, 2009 Share Posted January 14, 2009 ASMI, how is it that you know so much....??? Quote Link to comment Share on other sites More sharing options...
ASMI Posted January 14, 2009 Share Posted January 14, 2009 I have unpopular habit to read Help. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted January 14, 2009 Share Posted January 14, 2009 Thats a good habit to have... Quote Link to comment Share on other sites More sharing options...
CarlB Posted January 14, 2009 Share Posted January 14, 2009 Regarding transparent commands- the "command" defuns (defun c : xx) have been able to be called transparently for many years, don't know when it was first possible... The method ASMI describes is a way to do it for regular 'defuns', this is the first I've known about that method. Quote Link to comment Share on other sites More sharing options...
lpseifert Posted January 14, 2009 Share Posted January 14, 2009 It's been around for at least a few releases, I think I used a custom Mid2Pt with release 2006 (2005?) transparently. Quote Link to comment Share on other sites More sharing options...
ASMI Posted January 14, 2009 Share Posted January 14, 2009 The function vlax-add-cmd registers lisp-function as a standard AutoCAD command and determines its properties (read Help), also the full command ame and the alias. Please note that after downloading the previous listing expression (command "tt") works. Also, now the command _undo will work for standard AutoCAD commands. Quote Link to comment Share on other sites More sharing options...
ASMI Posted January 14, 2009 Share Posted January 14, 2009 the "command" defuns (defun c : xx) have been able to be called transparently for many years, don't know when it was first possible... I have not heard of this, perhaps it works in any version of it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.