Jump to content

Iterate through object snap modes?


bobsun

Recommended Posts

Hi,

 

When using object snap feature, if a particular point has multiple roles, by which I mean it could be {endpoint, node point, circle, intersection, etc.} at the same time, is there a way to toggle the snap point selection?

 

mt.png

 

For example, does there exist

  1. Key or key combination 1: Change the object snap mode to “single” amongst all enabled modes.
  2. Key or key combination 2: Iterate one by one through all available modes.

 

tg.jpg

 

Is it possible in AutoCAD?

 

 

Bob

Link to comment
Share on other sites

Move your cursor to approximately where you want to snap to and then whilst in your command repeatably press the tab key to cycle through the snap options.

 

You can also have a button on a palette with which you can preset your favorite snaps, the command string could be ^C^Cosmode;1; for end point, ^C^Cosmode;4; for center or ^C^Cosmode;5; for end point and center together.

Link to comment
Share on other sites

Tyke,

 

TAB worked, thanks.

 

What is CODMODE? I typed it and AutoCAD says it is not a command; nor could I find it in help. How do you do the preset? Could you explain in more detail?

 

 

Bob

Link to comment
Share on other sites

The command (system variable really) is OSMODE and its a system variable that holds a numeric value for the currently active object snaps.

 

^C in the command string is equivalent to pressing the escape key. The sample command strings are composed of two escapes ^C^C followed immediately (no space) by the system variable name OSMODE, a semicolon which is the same as pressing enter, the numeric value you want to assign to the system variable and finally another semicolon to finish off the command string. There's plenty of information about on the macros that can be used in a palette button.

Link to comment
Share on other sites

Tyke,

 

I see it, what you described are Macro operations.

 

I have some knowledge with MS Office VBA, so is AutoCAD macro similar to those recorded macros in MS Word/Excel? Is it written in LISP language or else?

 

 

Bob

Link to comment
Share on other sites

Tyke,

 

I see it, what you described are Macro operations.

 

I have some knowledge with MS Office VBA, so is AutoCAD macro similar to those recorded macros in MS Word/Excel? Is it written in LISP language or else?

Bob

 

 

No way! You can record a "macro", a sequence of key strokes, but unlike MS Office you can't edit it or even read it. If you want the same kind of macro in VBA you have to write it yourself, there's no record function in AutoCAD, although Joe Sutphin did write a macro to record a macro. The bad news is VBA in AutoCAD is on the way out, and it is no longer part of the delivered product, although you can still download the VBA module from the Autodesk web site. If that will still be an optiion in release 2013 is at the moment unknown. If you want to take up customisation of AutoCAD you can you can learn LISP or one of the .NET languages.

Link to comment
Share on other sites

No way! You can record a "macro", a sequence of key strokes, but unlike MS Office you can't edit it or even read it. If you want the same kind of macro in VBA you have to write it yourself,.
doesn't the action recorder allow you to edit the output? I haven't ggot a new enough version to try so I don't know.
Link to comment
Share on other sites

doesn't the action recorder allow you to edit the output? I haven't ggot a new enough version to try so I don't know.

 

Not as far as I know Dave. I had a look at it when it first came out and decided not to follow it up as you couldn't even read the output let alone edit it. So it was for me useless. I don't know if it has changed in later releases, perhaps someone else knows more about it.

Link to comment
Share on other sites

I saw it at a demo and they were editing it to show how flexible it was. It ALMOST got that version of ACAD installed just on that feature. Sounds like I had a lucky escape. :rofl:

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...