Enabling all snaps at the click of a button
I use Brics for 2d Traffic Management drawings through Cone 11.
When placing certain objects (such as T-junction markings or zigzags etc) it always disables the snaps. This means when you next hit F3 to enable entity snaps you have to manually go through and click all of these boxes.
I was wondering if there was a way I could use a LISP or Macro or some kind of script to basically do this clicking for me, preferably on a single keyboard shortcut.
Does anybody know if this is achievable, and how a n00b like me might accomplish it?
Many thanks
Comments
-
Hi SticksAndBrics,
Can't you get in touch with Cadaptor and make a feature request as it sounds like it is Cone 11 which is the issue?0 -
Hi David,
I believe you are right, and they do not have a fix for this as it seems to be a common issue with most Tm cad techs using the software. I would love to find a solution that, if it can't prevent the issue from happening in the first place, makes it super quick and easy to fix. I reckon my team will thank me if I'm able to work it out. Any suggestions?0 -
Attached is a custom command, aOsnap, that controls Osnaps in either of two ways:SticksAndBrics said:.... when you next hit F3 to enable entity snaps you have to manually go through and click all of these boxes.
I was wondering if there was a way I could use a LISP or Macro or some kind of script to basically do this clicking for me, preferably on a single keyboard shortcut. ....
1. When no command is active, it sets the value of the OSMODE variable.
2. When a command is active, it executes an Osnap Override for the next pick point.
So you can use aOsnap in a keyboard shortcut to do either of those things for any particular combination of Osnap modes. I don't use the built-in keyboard shortcuts, so I'm not sure of the syntax for them, but it's probably very similar to the Macro Express syntax that I use. In ME, I use the following:alt-W = 'aOsnap INT,ENDp,MID,CEN,QUA,NEA,NOD<ENTER>
alt-X = 'aOsnap PER<ENTER>
alt-T = 'aOsnap TAN<ENTER>
alt-E = 'aOsnap NON<ENTER>
To do the same thing in the Keyboard tab of the Customize panel, I think maybe you would have to use a semicolon (;) in place of<ENTER>
. You might also have to use a semicolon where my macro has a blank space. I don't see any blank spaces in the keyboard shortcuts that came with Bricscad.
I normally keep the alt-W combination as my running Osnap modes, but sometimes I'll turn Osnaps off for a while (or just for one pick point) by using alt-E. When I want to pick a perpendicular or tangent point, I'll use alt-X or alt-T for just that one point.
0 -
This is extremely valuable information Anthony, thank you so much for the details!Anthony Apostolaros said:
Attached is a custom command, aOsnap, that controls Osnaps in either of two ways:SticksAndBrics said:.... when you next hit F3 to enable entity snaps you have to manually go through and click all of these boxes.
I was wondering if there was a way I could use a LISP or Macro or some kind of script to basically do this clicking for me, preferably on a single keyboard shortcut. ....
1. When no command is active, it sets the value of the OSMODE variable.
2. When a command is active, it executes an Osnap Override for the next pick point.
So you can use aOsnap in a keyboard shortcut to do either of those things for any particular combination of Osnap modes. I don't use the built-in keyboard shortcuts, so I'm not sure of the syntax for them, but it's probably very similar to the Macro Express syntax that I use. In ME, I use the following:alt-W = 'aOsnap INT,ENDp,MID,CEN,QUA,NEA,NOD<ENTER>
alt-X = 'aOsnap PER<ENTER>
alt-T = 'aOsnap TAN<ENTER>
alt-E = 'aOsnap NON<ENTER>
To do the same thing in the Keyboard tab of the Customize panel, I think maybe you would have to use a semicolon (;) in place of<ENTER>
. You might also have to use a semicolon where my macro has a blank space. I don't see any blank spaces in the keyboard shortcuts that came with Bricscad.
I normally keep the alt-W combination as my running Osnap modes, but sometimes I'll turn Osnaps off for a while (or just for one pick point) by using alt-E. When I want to pick a perpendicular or tangent point, I'll use alt-X or alt-T for just that one point.
Annoyingly, I do not have permission to install 3rd-party software like Macro Express on work PCs, but how would I begin having a play around with this? Do I create a notepad folder with the code and run it as a lisp or something?
Sorry, actual newb struggles. Forgive my ignorance!0 -
You don't need Macro Express. I started using that 30 years ago, but keyboard macros are built in now. Instructions are posted at: https://help.bricsys.com/document/customizing--how_to_create_a_keyboard_shortcut/undefined/EN_US?id=165245343632
I just tested it and found that this works:'aOsnap;INT,ENDp,MID,CEN,QUA,NEA,NOD;
I couldn't assign that macro to alt-W, as I do in Macro Express. But I was able to assign it to Ctrl-W, and it works the same way.
I can't get the "Load Application" instructions to appear right now, but it's pretty simple:
1. Put the .lsp file in any folder.
2. Pull down Tools>Load Application (or enter Appload)
3. Click on the tiny icon for "Add application file"
4. Browse to the folder where you put the .lsp file and select it
5. Click in the AutoLoad box for that file
Then any custom command defined in the lsp file will be available any time.
Here's what that looks like in my v17:
You might not need aOsnap either. I like being able to use the same shortcut to set OSMODE and also to create an override for one pick point. But if you just want to set OSMODE, you can substitute'-Osnap
for'aOsnap
in the above. Then you'll be able to set the OSMODE variable even during a command. It won't apply only to the next pick point.0 -
I just noticed that the instructions I linked to are only for creating shortcuts to built-in commands.
To create a shortcut for a custom command, select the other radio button in step 6 -- "Create New Tool."
Then, instead of step 7, fill in the Title and Command fields.
0 -
Hold down Shift key and press right button on mouse built in. Maybe.
0 -
So this is really strange, as it seems that lisp works perfectly well. I was able to get the shortcuts to function well (under Ctrl+F3) whereby all the boxes are ticked when you use the assigned shortcut. That being said, when placing an object the snaps work the first time you place an object, but after hitting enter and it telling you to place the next object (you can continue to place them indefinitely) the snaps disable, and even using the shortcut does not tick the boxes (Though Bricscad seems to think the boxes are ticked as it displays Snaps as being active). I've contacted Cadaptor about it (Still no reply 2 weeks later) and at this point I'm just worried I'll be spending the rest of my life ticking these boxes. I appreciate it's not the best video but hopefully the attached file shows where the sequence fails - right after an object has been placed, the red boxes disappear when prompted to place the next set of zigzags.
Any assistance again would be greatly appreciated, and thank you so much to those of you that have given your invaluable support so far.0 -
My apologies the video did not upload. Here is it converted to a gif (sorry about the quality drop)
0 -
....0
-
0
-
How do you know it thinks that? In your GIF image, I don't see the array of Osnap icons that's supposed to show that. I see it in my own system when the Bricscad>Entity Snaps toolbar is enabled (with blue shading to indicate which ones are on).SticksAndBrics said:.... Bricscad seems to think the boxes are ticked as it displays Snaps as being active ....
Even that toolbar is not a completely reliable indicator, at least in my v17. When I use one of my 'aOsnap macros during a command (or when I enter an override from the keyboard or from the Entity Snap Overrides sub-menu of the right-click menu), those icons change to show the override snap modes, but they don't change back to reflect the OSMODE value after picking the point, though the OSMODE value is clearly being used for subsequent points. The icons don't change back until after the command is over. If I use another override later during the command, the icons change to reflect that, but they don't change again until either another override is used or the command ends.
I don't see any use of the aOsnap command on the command line in your GIF image. Did you use it during the demonstration? Since you said that it only works the first time, maybe you shouldn't use aOsnap, but instead use '-osnap so that you'll be changing the OSMODE value rather than just issuing an override.
I can't tell from the GIF image what the Cadaptor software is doing to affect your Osnap settings. Maybe if you turned on your Entity Snaps toolbar you'd see more clearly what it's doing and when. But not necessarily -- there's a setting for the OSMODE variable that turns off all Osnap activity without de-selecting osnap modes. If I set my normal running Osnap modes (INT,ENDp,MID,CEN,QUA,NEA,NOD) but then go into the OSMODE section of the Settings dialog and select "16384 Turn off all snaps," then all my osnap icons are still blue-shaded as if they were on, but I can't snap to any osnap points. I guess the F3 that you mentioned in your first post toggles that 16384 bit ON/OFF, so your first post suggests that Cadaptor isn't just changing that.
0 -
Hi Guys, as of just now I have received word from Cadaptor and they acknowledge that this is an issue on their end, which they are currently working towards fixing. They reckon a code update will be necessary so I'm sure we'll get an update soon. Thank you all for your brilliant help, none of it was wasted on me as I learned a lot trying to fix this issue.
Big love0 -
Also, thank you Anthony, you were on the money here.Anthony Apostolaros said:
How do you know it thinks that? In your GIF image, I don't see the array of Osnap icons that's supposed to show that. I see it in my own system when the Bricscad>Entity Snaps toolbar is enabled (with blue shading to indicate which ones are on).SticksAndBrics said:.... Bricscad seems to think the boxes are ticked as it displays Snaps as being active ....
Even that toolbar is not a completely reliable indicator, at least in my v17. When I use one of my 'aOsnap macros during a command (or when I enter an override from the keyboard or from the Entity Snap Overrides sub-menu of the right-click menu), those icons change to show the override snap modes, but they don't change back to reflect the OSMODE value after picking the point, though the OSMODE value is clearly being used for subsequent points. The icons don't change back until after the command is over. If I use another override later during the command, the icons change to reflect that, but they don't change again until either another override is used or the command ends.
I don't see any use of the aOsnap command on the command line in your GIF image. Did you use it during the demonstration? Since you said that it only works the first time, maybe you shouldn't use aOsnap, but instead use '-osnap so that you'll be changing the OSMODE value rather than just issuing an override.
I can't tell from the GIF image what the Cadaptor software is doing to affect your Osnap settings. Maybe if you turned on your Entity Snaps toolbar you'd see more clearly what it's doing and when. But not necessarily -- there's a setting for the OSMODE variable that turns off all Osnap activity without de-selecting osnap modes. If I set my normal running Osnap modes (INT,ENDp,MID,CEN,QUA,NEA,NOD) but then go into the OSMODE section of the Settings dialog and select "16384 Turn off all snaps," then all my osnap icons are still blue-shaded as if they were on, but I can't snap to any osnap points. I guess the F3 that you mentioned in your first post toggles that 16384 bit ON/OFF, so your first post suggests that Cadaptor isn't just changing that.0 -
I just made a custom toolbar button with the snaps I like to use...
Right click on the border, "customize", "toolbars", find a toolbar that work for you, "append tool"
0