The code didn't work, it's just blank?
You need to replace Property Name Here with the required property name. And then make sure that part configuration has that property and some value.
That's the thing, I don't know what the property name is. I don't think there is one?
What Deepak said. Or use the Link to Property button when inserting the Note. The screenshot is one I'd saved a while ago for another post, but you would choose "Component to which the annotation is attached" and Description should show in the drop-down.
I like using this button when linking a note so I don't have to worry about entering the text perfectly for it to work.
In the solid drawing (slddrw) I added the note and tried the link to property box, but the one I want is not there.
It isn't the file name, it's the Description (under Configuration Properties in the Part model. It has "use in bill of materials" checked underneath it).
Under "component to which the annotation is attached", you can choose SW-Configuration Name, but not description.
I tried the other selections (current document, etc) too.
(Using solidworks 2013 sp5 by the way)
Phil, select the box to the right, File Properties and select desciption.
Chris, I'm not looking to manually add it to a table. I'm looking to see if it already exists, so I can just select it.
Otherwise, I would just type it straight into the note.
Phil, did you ever get anywhere with this? I'm having exactly the same problem, and have met with exactly as much success as you did.
I figured there must be a way to get to the configuration description but just as you and Phil found there does not appear to be a built in method.
I have found another method that will work.
You will need to create a custom property to contain the value of the Configuration Description. You can easily link your drawing note to the custom property. The issue - obviously - is how to get the data into the custom property. A little undocumented VBA coding in the equation manager will get it done.
As has been discussed in other threads, you can add VBA code into an equation.
In this case do the following:
- Create a custom property to contain the configuration description. I called mine "Config_Description"
- Set its value (temporary) to something like xxx such that it will be obvious when it is overwritten.
- In the equation editor create a global variable called VBADummy.
- Set its value to an arbitrary integer - lets use 3.
- Close the equation manager to save this new global variable.
- Reopen the equation manager and overwrite the value of the VBADummy variable with the following
- If your custom property is named something other than Config_Description, you will need to modify the formula to match. Where you split the name of your property is irrelevant, but it must be broken into two or more pieces.
- This code gets the value of the current configuration's description and puts it in your new custom property.
- Close the equation manager.
- Click YES to the syntax error message that appears (normal and expected with this method).
- Perform a CTRL-Q rebuild.
- Your VBADummy should evaluate to -1 (visible in the Feature Tree Equations folder)
- Open your custom properties and the value of your new variable should match the configuration description (xxx overwritten).
This will work for a single configuration part. If you have multiple configurations a full macro might be required.
Hope this helps.
Thanks Daen. I wasn't able to get this to work on the first couple of tries (2014SP3). In any case, we frequently use multi-configuration parts so it doesn't sound like it would address every situation for me anyway.
I am also interested in how to do this....seems like there should be a "Link to Property" feature like SW-Configuration Name(Configuration Name) but with configuration description...SW-Configuration Description(Configuration Description)
I realized this is marked as answered, but I believe I may have a solution that does make the configuration description accessible as an automatically updated property.
Using a design table, add a column for $DESCRIPTION, which is the configuration's description.
To the right of this column, create a custom property column, say $PRP@ConfigDesc ("ConfigDesc" is the property name, but call it what you wish).
In the $PRP@ConfigDesc column, type an Excel formula that references the cell to the left of the current cell (the description cell), i.e.: "=B3" if the current cell (custom property) is "C3").
Now you have a custom property linked to the configuration description.
Search SW's help on "$DESCRIPTION" and "$PRP" for more info.
Some final notes:
1) You'll probably need to add this custom property name to your custom properties text file in order for SW to "see" it elsewhere.
2) This custom property is on the config properties tab of the properties dialog, not the general properties tab.
3) You'll have to copy and paste existing descriptions into the design table for current parts.
4) You may want to set your design table's properties to driven by model changes only so the "standard" method of adding config descriptions remains the same for all, while under the hood, the design table takes care of maintaining the custom property.
5) If I may suggest, once you get this ironed out and it's a go-forward solution:
A) Create the design table as an external Excel file all set up and ready to be brought into other files.
B) For new files, add this design table (or add just these columns into your existing table) to your part & assemblies templates.
I hope this helps.
I tried to follow your steps above, but was unable to get good results. I kept getting =F3 instead of the value in $Description
Check out my crazy informative picture below.
BLUE is the value I want.
PURPLE is the value I get.
RED is the value BLUE overwrites in the BOM.
I have had no success in linking BLUE to a note on the drawing.
Nope wait figured it out!
The column for $Description was set to Text instead of General for some reason so it kept putting a single quote thing in front of the =F3 so it read '=F3 instead of the cell information!
And it updates when I switch configurations in the drawing, no matter if "use in bill of materials" is checked or not!
Thanks a bunch!
yeah - the design table template formats the entire sheet as text. never understood that decision.
Instead of using a design table, trying checking "Use in bill of materials" in configuration properties.
See "Configuration Properties PropertyManager" in help.