Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

SW 05/Attribute transfer from Part to Drawing???

Status
Not open for further replies.

markhp48

Mechanical
Jan 6, 2006
17
I am trying to populate & transfer the attributes from my part to its associated drawing file for final mapping & eventual use in a PLM/PDM vault application that will simply read data from one file. In short, you usually fill out these attributes after creating a part, by accessing File-Properties-Custom tab, selecting or creating your Property Name prompts(tags) & then populating your list values as necessary. Is there any way to carry these same Tags & Values from the part-assy file over to its drawing file without having to recreate the wheel & raise the potential for errors? Also by chance, while in the same Custom tab dialog box & after creating a Custom Property tag, would anyone out there know how to enter a Value/text expression as a Drop Down choice with the type set to text?

I'll buy you a beer, maybe a couple for both answers.

Mark
 
Replies continue below

Recommended for you

I have also tried to do exactly what he is saying (copy part/assembly properties to the drawing custom properties. The reason I wanted this was so that the properties were visible by using windows explorer.
However I believe the only way to do this is by using a macro feature so that when the drawing is rebuilt the properties of the part/assembly are read and then copied to the drawing properties. I haven't seen a macro yet that does this, but it should be possible.

ta
 
I typed $PRPSHEET:"Description" in the Value/Text Expression field while in the drawing to attempt to transfer that property from the model itself. It simply evaluates to just $PRPSHEET:"Description" & not to the value assigned while in the model-part Custom Properties. Of course the above procedure works nicely for annotations placed on the drawing or in the sheet format. What are my alternatives?
 
The $PRPSHEET: thing seems to have changed. It used to evaluate in the property editor. It does still evaluate if you use that property in a note in the drawing.

strange
 
markhp48 ... OK, thats what I was suspecting. What you are seeing is exactly what should happen. In the Value/Text Dexcription field you need to type the actual description that you wish to see in the linked notes. ie; if the description should be "Left Handed Widget", then type in Left Handed Widget. The linked note in the drawing is reporting exactly what you have input into the Property field.

[cheers]
Helpful SW websites FAQ559-520
How to get answers to your SW questions FAQ559-1091
 
wgchere, rmars ... Re-read the posts. Getting the properties into a PDM system is his ultimate goal, but he has been unable to get the properties to show correctly in the drawings.

[cheers]
Helpful SW websites FAQ559-520
How to get answers to your SW questions FAQ559-1091
 
A lot of good advice, but I'm essentially where I started. Now for a slightly related question, how do I create custom Drop Downs(choice lists) for the Value-Text Expression of the Custom Properties while in a SW drawing? I need to have a custom list of drop downs available for a custom property in the Custom Props dialog box in a drawing. I'm not so sure we can migrate(link) Custom Props & Values from the model to drawing in the Custom Props dialog for eventual attribute transfer in to my PDM app. I know how to link annotations on the drawing. That is not the issue. It's Friday & Thanks for your help.
 
Any other suggestions out there on custom prop migration(values included) from part to drawing within the Custom Props dialog only? Otherwise, I will have to tell this engr office that it cannot be done & they will have to populate each files' custom properties individually before loading into the vault area of our PDM.

Thx

Mark H
mech engr
FPI
 
As far as I know, there is no way of linking a drawing’s property to a model’s property. That said, one can create a macro / VB program to copy the properties from a model into a drawing. I have written one which does this for the description and number properties. If you would like to attempt to modify it to suit your needs, I can post a link to it.

You can’t add a dropdown to the file -> properties page either. However a macro / VB program with dropdowns can be created. PropertyEditorSpec, which can be found at: may do most if not all of what you are looking for. It is what I used as a reference when I made the app to copy the properties over.

Eric
 
Eric-Thanks I'll check out your suggestion.

Mark
 
At no point in this discussion was it clear to me that anyone pointed out that the model property does not transfer to the drawing field unless the drawing and the model are both open. Or did I miss that part?

--
Hardie "Crashj" Johnson
SW 2005 SP 4.0 (reluctant to change)
Matrox Millenium G550
AMD Athalon 1.8 GHz 512 Meg RAM

 
They do not transfer from within the Custom Props from my understanding. They are to be entered seperately-a pain. One set of data should apply to the part & its assoc drawing, since I want our PDM-valult system to use just one set of attributes for simplicity. Now I've got to figure out how to use one of the macros that Eric suggested. Onward.
 
The links to your properties (from the model) on your drawing should contain the $PRP: (not the $PRPSHEET:), which was explained on an eariler reply (checking bullet "model view specified in sheet properties" when selecting the link property.

Examples:

$PRPSHEET:"SW-File Name" = takes info from the drawing properties (in this case, the file name).

$PRP:"SW-File Name" = takes info from the part (model) properties (in this case, the file name).

Summary:

$PRPSHEET: TAKES INFO THAT WAS INPUT TO THE DRAWING
$PRP: TAKES INFOR THAT WAS INPUT TO THE PART (MODEL)


If you do this right, you should not need any properties in the drawing, since everything should be coming from the part (model).
 
Correct definitions....$PRP links to properties in the current document whereas $PRPSHEET links to props of the model in the view specified in the sheet properties of the drawing. No problem with annotation-sheet format links & evaluations. Now while in a drawing file, try to make evaluations of $PRPSHEET which is pulling link data from the model from within the Custom Properties dialog. They will not evaluate, therefore problematic.
 
OOPS, yes, sorry (I even thought I tried that before I posted).

I'm still trying to understand what you mean by "evaluations". Are you saying that when in a drawing, you select file, properties and expect to see what you had typed in for properties in the part properties?
 
I checked again, and I feel I was right the first time. Just "evaluating" $PRP instead of $PRPSHEET. Otherwise, I just can't understand what you are talking about.
 
Clarification: $PRPSHEET:"value text-expression" will not evaluate at least from my observations while in the Custom Props dialog. $PRP works fine.
 
You may want to to check into an add-in called customworks. I've played with it a little and I believe it will do most of what you ask. The app is about $800.

I agree however SW should do more in the way of custom properties.

Rob Rodriguez CSWP
President: Northern
Vermont SolidWorks User Group
(updated 2/22/06)
SW 2006 SP 3.0
 
Simplest way to copy custom properties from part file to drawing file in API is to assume that the drawing has the same name as the part:

-with the part open, create a ModelDoc2 object equal to the part
-use ModelDoc2.GetCustomInfoNames2 to get names of the desired properties
-use GetCustomInfoTypes2 and CustomInfo3 to get types and values (respectively) of the custom properties, using names obtained in the last step
-use ModelDoc2.getPathName to get the save path of the current part model
-use string manipulation to strip SLDPRT or SLDASM from the pathname and replace it with SLDDRW to get the drawing pathname
-use openDoc6 or GetOpenDocumentByName to open the drawing using the above pathname
-delete custom properties of the drawing (retrive names using getCustomInfoNames then use deleteCustomInfo to loop through each property and delete it)
-add custom properties to the drawing using custom property names, values and types obtained from the part above
-save the drawing (AddCustomInfo3)

This can also be done from outside of Solidworks using the windows DSO method, but as far as I can tell DSO will turn all properties to type "text". You also can't use DSO if the drawing is open in Solidworks.



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor