Custom properties: Selectively enabling/disabling a note?
Custom properties: Selectively enabling/disabling a note?
(OP)
I'm hoping this is easy but I have a feeling it's not supported.
Is there a way through the custom properties to disable/enable a specific note without simply clearing it to a space?
E.g. I'd like to have a "Draft saved <date> by <person>" (which I can easily do with a note) enabled/disabled externally (like thru Solidworks explorer). If it were a simpler string I would just clear it to " " but since it contains references to sheet properties it would be a hassle if I wanted to enable it again.
Any ideas?
(SW2006)
Is there a way through the custom properties to disable/enable a specific note without simply clearing it to a space?
E.g. I'd like to have a "Draft saved <date> by <person>" (which I can easily do with a note) enabled/disabled externally (like thru Solidworks explorer). If it were a simpler string I would just clear it to " " but since it contains references to sheet properties it would be a hassle if I wanted to enable it again.
Any ideas?
(SW2006)






RE: Custom properties: Selectively enabling/disabling a note?
Can you just move the note out of the printed area?
Better yet create and use a different Sheet Formats. One with the note and one without. Then simply switch the SF to suit.
RE: Custom properties: Selectively enabling/disabling a note?
Right now I'm planning on moving it out of the printed area, but was hoping maybe there was an option I didn't know about.
RE: Custom properties: Selectively enabling/disabling a note?
FAQ559-1429: How To Change Or Manage Document Properties And Templates.
RE: Custom properties: Selectively enabling/disabling a note?
Switching templates? I took a quick look at the linked FAQ, but I didn't see anything about switching templates without SW open. Did you mean custom properties?
-handleman, CSWP (The new, easy test)
RE: Custom properties: Selectively enabling/disabling a note?
Propagator from http://www.customsolids.com/Propa-Gator.htm
Not sure if the following needs SW open;
TemplateSwitch from http
SWcp3 from http://www.swcp3.com/
pac4swx_mac01.zip from http://swtools.cad.de/macros.htm
RE: Custom properties: Selectively enabling/disabling a note?
I swear, I'm not just trying to be a pain...
-handleman, CSWP (The new, easy test)
RE: Custom properties: Selectively enabling/disabling a note?
RE: Custom properties: Selectively enabling/disabling a note?
I have used Propagator and confirm that it definitely does switch templates/sheet formats.
htt
http://www.customsolids.com/Simplify/Page3.htm
RE: Custom properties: Selectively enabling/disabling a note?
Do you still run PropaGator? I'm very curious as to whether it actually opens SW in the background to do the sheet format change. I don't see how it would do it otherwise, since the sheet format data (title block lines, notes etc) is saved in the drawing file.
-handleman, CSWP (The new, easy test)
RE: Custom properties: Selectively enabling/disabling a note?
If I remember correctly, SW is opened in the background.
RE: Custom properties: Selectively enabling/disabling a note?
Do you have any other programs that can edit the custom properties without SW? I believe all PDMWorks Enterprise did was change the text from something i.e. Advanced Print to a blank or space.
Don
RE: Custom properties: Selectively enabling/disabling a note?
1) unhide note(s) if hidden (and how?)
2) save
3) save as pdf
Similarly, another to do the same except to hide if not hidden.
RE: Custom properties: Selectively enabling/disabling a note?
RE: Custom properties: Selectively enabling/disabling a note?
I'm mostly concerned with either a) making it controllable outside solidworks (my original post) or b) making a macro that automates saving with "UNRELEASED" (and the save date) enabled. (The other macro would be used upon drawing release)
Once we get some PDM going this may become a non-issue, but for now I'm working with what I've got. Moving the note on/off the drawing is not bad for one-offs but when it's 20-30 drawings I'll spend 10 minutes to save 20 if I can.
RE: Custom properties: Selectively enabling/disabling a note?
RE: Custom properties: Selectively enabling/disabling a note?
Answer for (1)
-I "think" you can give a note a name that you can later use for selecting it in a macro.
-You could definintely select the note with a macro if you know what text it contained.
-Using layers as CorBlimeyLimey suggested above is the way I've seen this handled before...but once the more inquisitive Users figure that out, this is the easiest (of the methods mentioned above) for them to get around. But then again, at least one of them will always find a work-around.
WeThey can be very ingenious.Answer for (2)
-Absolutely
Ken
RE: Custom properties: Selectively enabling/disabling a note?
It would also be possible, although roundabout, to enable/disable through SW Explorer... sort of. Really it would just move the note off the sheet printable space. However, you would have to use two custom properties working together. The following method assumes that you want to control visibility of this note through the drawing's custom properties and not the model's, although it would pretty much work just the same for model custom props.
First, create the note as you want it, including the links to the custom properties for <drawn> and <date>, whatever those are named. Then, at the very beginning of the note, add a link to a custom property called "SpaceToggle".
Now add two custom properties - One called "SpaceToggle" and one called "Spaces". For the value of "SpaceToggle", enter:
$PRP:"Spaces"
for the value of "Spaces", just put in enough spaces to move the note off the screen. When SW generates the final note text, it will actually evaluate the $PRP link contained in SpaceToggle and insert the value of "Spaces" into the note.
Now, when you want to show the note, you can edit the custom properties (either in SW or SW Explorer) and change the value of "SpaceToggle" to $PRP:"noSpaces". Then when SW tries to evaluate the note, it will not find any property called "noSpaces" so the spaces will not be stuck into the note.
Of course, there's nothing special about the names of the properties. You can call them whatever you want.
-handleman, CSWP (The new, easy test)
RE: Custom properties: Selectively enabling/disabling a note?
Could a macro access and alter drawing layer states?
RE: Custom properties: Selectively enabling/disabling a note?
Here's code to toggle a given layer on or off. Very small and sloppy mod to something I posted way back. Just enter the name of the layer you're interested in quotes in the Const LAYERNAME.... line.
CODE
Const LAYERNAME As String = "Enter layer name here"
Dim swApp As SldWorks.SldWorks
Dim swDoc As SldWorks.ModelDoc2
Dim swDwg As SldWorks.DrawingDoc
Dim swLyrMgr As SldWorks.LayerMgr
Dim swLayer As SldWorks.Layer
Sub LayerColorChange()
Set swApp = Application.SldWorks
Set swDoc = swApp.ActiveDoc
If swDocDRAWING <> swDoc.GetType Then
MsgBox "This only works for drawings"
Exit Sub
End If
Set swDwg = swDoc
Set swLyrMgr = swDoc.GetLayerManager
If COLORQUERY Then
Set swLayer = swLyrMgr.GetLayer(swLyrMgr.GetCurrentLayer)
MsgBox "The color of layer " & swLayer.Name & " is " & swLayer.Color
Exit Sub
End If
''''''''''''
'copy and paste this block until you have as many as you want
Set swLayer = swLyrMgr.GetLayer(LAYERNAME)
'swLayer.Color = 255 'Type the number for the desired color here.
''''''''''''
If swLayer.Visible = False Then
swLayer.Visible = True
Else
swLayer.Visible = False
End If
End Sub
-handleman, CSWP (The new, easy test)