Jump to content

Is it possible...


Rooster

Recommended Posts

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)

)

Link to comment
Share on other sites

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

button.jpg

Link to comment
Share on other sites

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! :P

Link to comment
Share on other sites

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 :D

Link to comment
Share on other sites

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 :D

 

Thats a cool idea. Never thought of that one before.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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]:

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...