Hi All,
I have a drawing with text controlled with Custom Properties/Data Card selection.
I have arrows shown on the drawing, pointing left or right, each on separate layers. Based on data card selection, I have to open up the Layer properties and toggle visibility. Ideally, I I'd like to cut down on the number of mouse clicks and hit a button.
Has anyone done anything like this?
Thanks,
Layer visibility toggle
- jcapriotti
- Posts: 1854
- Joined: Wed Mar 10, 2021 6:39 pm
- Location: The south
- x 1196
- x 1988
Re: Layer visibility toggle
If by "Data Card" you mean the PDM Data Card, I can't think of an automatic way to do this on opening the drawing. You can write a macro that will toggle the two layers which would save a few steps of opening the layer manager and closing it.
Jason
Re: Layer visibility toggle
Jason,
Yes, I meant with the PDM data card. I have the text change working fine via the data card/custom properties. It doesn't need to happen automatically when opening the drawing.
Yes, the layer manager is what I'm trying to avoid. I've not written a macro in a long time. I tried to record a macro, but it didn't seem to capture the layer toggle in the layer manager. Guess I'll have to dig a little more into it. Can the macro be embedded in the drawing template, so it's always there?
Thanks,
Mike
Yes, I meant with the PDM data card. I have the text change working fine via the data card/custom properties. It doesn't need to happen automatically when opening the drawing.
Yes, the layer manager is what I'm trying to avoid. I've not written a macro in a long time. I tried to record a macro, but it didn't seem to capture the layer toggle in the layer manager. Guess I'll have to dig a little more into it. Can the macro be embedded in the drawing template, so it's always there?
Thanks,
Mike
Re: Layer visibility toggle
I found some example code on the forum and was able to put something together that works.
https://www.cadforum.net/viewtopic.php? ... yer#p32178
Thanks,
Mike
https://www.cadforum.net/viewtopic.php? ... yer#p32178
Thanks,
Mike
- jcapriotti
- Posts: 1854
- Joined: Wed Mar 10, 2021 6:39 pm
- Location: The south
- x 1196
- x 1988
Re: Layer visibility toggle
You can create your own tab on the Command Manager and put a button there for it. Then you would need to share your toolbar settings with your company if needed.
Jason
Re: Layer visibility toggle
Thanks Jason, I figured that out yesterday, as well.jcapriotti wrote: ↑Tue Nov 05, 2024 9:47 am You can create your own tab on the Command Manager and put a button there for it. Then you would need to share your toolbar settings with your company if needed.
image.png
The last time I used macros was back in 2012 when using Inventor, where the macros could be stored in the default.ivb. Wasn't used how SW does it, by storing in it's own file. I'll be exploring macros more, as time permits. I need to re-learn the basics, but getting this simple one done, will be extremely helpful.
Thanks,
Mike