Visually See if SNAP is ON via color Swatch?

Visually See if SNAP is ON via color Swatch?

johnw
Collaborator Collaborator
4,192 Views
59 Replies
Message 1 of 60

Visually See if SNAP is ON via color Swatch?

johnw
Collaborator
Collaborator

We use SNAP when we draw and as a trainer I would like to easily see if someone has SNAP ON or OFF with a color swatch displayed on the ribbon panel. Is there a way to display a green swatch that is large enough to see from a distance if SNAP is ON and it turn RED if SNAP is OFF? Some folks use the classic toolbar menu as well so the swatch for that would have to be located at the bottom left of the menu in the startup. If someone could show me how to show this color switch in a Ribbon panel setting and as lower left corner of classic window setting that would be fantastic.

 

Much thanks,

 

John W.

0 Likes
Accepted solutions (1)
4,193 Views
59 Replies
Replies (59)
Message 41 of 60

alexKoshman
Collaborator
Collaborator

Hmmm... You are right... ; ))

 

Than can be done! With additional test for CVPORT system variable!

 

But not today!.. ; ))

0 Likes
Message 42 of 60

alexKoshman
Collaborator
Collaborator

Hi JohnW!

 

Sorry for delay! Now I'm ready! ; ))

 

Try it!..

0 Likes
Message 43 of 60

johnw
Collaborator
Collaborator
Hi Alex, the crosshair colors seem to work great now! The only problem I have is then I enter a command like (Line, Move, Copy, Scale, Stretch, or Mirror) my system automatically turns snap on and when doing so the crosshairs change back to white BUT cancel these commands and I have to re-enter them again. The same thing happens with grips. If SNAP is off and I make a grip hot, my system has a routine that turns snap on which prevents anyone from 'working around" my routine that turns snap on automatically. When I select the grip now with snap off, the crosshairs turn back white but I have to re-select the grip again. I show the code that turns snap on as well as the code that turns snap on when grips are hot. I don't know which routine(s) would have to be modified to prevent the crosshair color change from cancelling these commands.

I have (SM) load in a macro before my "LINE" command is entered.

;TURNS SNAP ON BEFORE A COMMAND IS ENTERED
(DEFUN SM ()
(setvar "cmdecho" 0)
(SETQ SM (GETVAR "SNAPMODE"))
(IF (NOT (= SM "0"))
(progn
(setvar "snapmode" 1)
)
(progn
(alert "snaps already on")
)
)
(setvar "cmdecho" 1)
(PRIN1)
)



;TURNS SNAP ON WHEN A GRIP IS SELECTED


(defun MY_SNAPMODE (rea clb) (if (wcmatch (strcase (car clb)) "*LINE*,*MOVE*,*COPY*,*SCALE*,*STRETCH*,*MIRROR*,*LENGTHEN*") (setvar 'SNAPMODE 1) ) ) (if *UCReactor (progn (vlr-remove *UCReactor) (setq *UCReactor nil MY_SNAPMODE nil ) (prompt "\n>>>>> SNAPMODE reactor is stopped!!! ") ) (progn (setq *UCReactor (vlr-command-reactor "SNAPMODE reactor" '((:vlr-commandWillStart . MY_SNAPMODE)) ) ) (prompt "\n>>>>> SNAPMODE reactor is starting... ") ) ) (princ) )
0 Likes
Message 44 of 60

johnw
Collaborator
Collaborator
Hi Alex, the crosshair colors seem to work great now! The only problem I have is then I enter a command like (Line, Move, Copy, Scale, Stretch, or Mirror) my system automatically turns snap on and when doing so the crosshairs change back to white BUT cancel these commands and I have to re-enter them again. The same thing happens with grips. If SNAP is off and I make a grip hot, my system has a routine that turns snap on which prevents anyone from 'working around" my routine that turns snap on automatically. When I select the grip now with snap off, the crosshairs turn back white but I have to re-select the grip again. I show the code that turns snap on as well as the code that turns snap on when grips are hot. I don't know which routine(s) would have to be modified to prevent the crosshair color change from cancelling these commands.
0 Likes
Message 45 of 60

alexKoshman
Collaborator
Collaborator

Hello JohnW!

 

There was some garbage text, I was wrong, sorry...

 

I will try to think about it...

Here is the evening...

; ))

Message 46 of 60

alexKoshman
Collaborator
Collaborator

I think you as a teacher, tutor, trainer and coach ; )) have to COMPLETELY REMOVE all the stuff you made for "prevent" all the mistakes that your students CAN make in the future in their work.

I call it "poor Elza's syndrome". I think it's also known as "clever Elza's syndrome"...

 

You DON'T HAVE to "prevent" users\students from their mistakes in their studies.

You just have to SHOW them their mistakes and faults.

And TEACH them to prevent them by themselves...

 

There ARE NO such a tools In the "good old" plain and honest AutoCAD.

 

Therefore I wrote this Reactor for you.

And therefore I won't build another code in it.

Sorry for teaching...

; ))

 

What do you think about?..

; ))

 

P.S.

-----

I think you aren't right always "forcing" SNAP On for Grip Editing for your students.

Because they can use Object Snaps and don't need the SNAP at all.

 

And you forgot that "in real world" we don't use SNAP at all for a long time! ; )))

 

0 Likes
Message 47 of 60

johnw
Collaborator
Collaborator

Thanks Alex. I appreciate the effort and the comments. Folks in the normal autocad world think running osnaps are the only thing needed. In our system using running osnaps are actually a hinderance and cause employees a lot of agrevation. I only have these preventative measures set up to prevent delays in projects being completed due to someone drawing "off snap" by accident.

 

Again, thank you for your help. This routine will surely help us!

 

John

0 Likes
Message 48 of 60

alexKoshman
Collaborator
Collaborator

Understand!

Can you tell me what is the specific of your work with the old good Snap and with no OSnaps?..

I think there are no such a places any more where people still use the "old forgotten" SNAP!..

; ))

 

At the first day of teaching and for the first educational task I still give for my students and pupils (more precisely "gave"! ; )) and give now - for newbie coworkers) the SNAP and GRID just in the educational purposes (to accustom them to drafting accuracy) and for that (probably) rare occasion when they could use the SNAP in their work...

 

One more question!

Why you want to show them the current Snap mode if you turn the Snap On all the same before they could pick a point without the Snap... so they can't get rid of that your damned Snap? ; ))

0 Likes
Message 49 of 60

johnw
Collaborator
Collaborator
To clarify...we do you Osnap at times but NO RUNNING OSNAPS. The snap set at 1" allows us to draw walls at nominal dimensions. All linework is drawn at 1" increments so inserting appliances, plumbing blocks, etc are easily placed on an actual "point" in space. This way when we dimension we do not get any fractions. If SNAP was off, and we drew walls, we would from that point forward have to use the original lines as reference to keep numbers whole (no fractional distances). With SNAP on, any line I draw anywhere will be an exact distance from another line I draw without having to offset from the original linework I drew. I am free to draw lines and objects anywhere in a drawing and when locating them with dimensions I will always get a whole number. Plus if I have to move walls, I can just grab them and move them over with ortho on and not have to worry about using some OSNAP TOOL to place them in the correct location. I can just move at will and they will remain at 1" increments. We do have lisp routines that create openings and such that turn on running osnaps for the command but then turn them back off once the command is completed.

Funny thing is, when I start new hires, they cannot understand why we don't using running osnaps, and after they are here for a few months...and I turn secretly turn on their running osnaps as a joke....they freak out and cannot stand it when they are on. Within minutes they are cursing "Who turned on my running osnaps!" pretty funny.
0 Likes
Message 50 of 60

alexKoshman
Collaborator
Collaborator

Glad to hear your are my collegue building designer!   ; ))

 

Understand your attitude towards Snap and OSnap...

 

Your are lucky!

Your Walls have whole number unit dimensions in inches. Our Walls may have a very strange dimensions (hello to architects!) in the new building construction, and may have the dimensions like "6347 mm" in the sphere of old building reconstruction...

: ((

0 Likes
Message 51 of 60

johnw
Collaborator
Collaborator
So technically if you set your snap to 1 mm, you could draw all your linework at "exact millimeter" distances. Yeah I know, that's a bit small.
0 Likes
Message 52 of 60

alexKoshman
Collaborator
Collaborator

In your last program listing there's one unbalanced closing bracket!

Your LISP doesn't work as it have to do!..

 

I think you do not copy ALL of your code!

Best thing is to attach the whole file!..

 

About "1 mm" ; ))

Our Walls are not all perpendiculars, so their lengths are not precise at all.

Welcome to our world!..  ; ))

0 Likes
Message 53 of 60

johnw
Collaborator
Collaborator

oh no! can you point it out to me so I can fix????

0 Likes
Message 54 of 60

alexKoshman
Collaborator
Collaborator

Please attach your lisp about "autoTurningOn" the Snap!..

 

I think the last closing bracket is the extra!..

0 Likes
Message 55 of 60

johnw
Collaborator
Collaborator
[cid:image001.png@01D0BA65.C5C06D10]

When I start Autocad this message pops up. Does it have to do with anything you just mentioned about my snap turning on?
0 Likes
Message 56 of 60

alexKoshman
Collaborator
Collaborator

Cant see your image!!

Just the very strange string of code! ; )))

 

The last closing bracket IS the extra bracket!..  ; )))

0 Likes
Message 57 of 60

johnw
Collaborator
Collaborator

snap issue.png

0 Likes
Message 58 of 60

alexKoshman
Collaborator
Collaborator

I got it!..

Changing crosshair color cancels current command!..

: ((

 

Can't figure it out yet...

 

Try to enter for example: "(vla-put-ModelCrosshairColor (vla-get-display (vla-get-preferences (vlax-get-acad-object))) (vlax-make-variant 255 19))" at the command line within any command (current color have to be NOT red!) and you will see it...

: ((

0 Likes
Message 59 of 60

alexKoshman
Collaborator
Collaborator

In your FIRST listing there were NO such a string "(defun snapgrip ..."!

Why you invented it?? ; ))

 

You have to remove THE LAST bracket!

 

Your code have three independent parts:

1. "(DEFUN SM ...)"

2. "(defun MY_SNAPMODE ...)"

3. "(if *UCReactor ...)"

4. and you can add "(princ)" at the end of your LSP file to prevent getting "nil" at the command line when this lisp loads.

 

The last bracket (after "(princ)") is the garbage!

 

 

...And now I go to bed!.. There's midnight here!.. ; ))))

0 Likes
Message 60 of 60

johnw
Collaborator
Collaborator
Thanks! Good night!
0 Likes