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!

link custom props to drawings 2

Status
Not open for further replies.

andrewjohns

Mechanical
Sep 18, 2003
9
How can I link the custom props of parts/assemblies to the custom props of a drawing.
eg part property 'PartNum' link to drawing property 'PartNum'
I know how to display the part/assembly props in a drawing, but I cant see how to then link that data into a drawing property.
 
Replies continue below

Recommended for you

Read the Link to property section in the Index of the SW Help.

Helpful SW websites faq559-520
How to get answers faq559-1091
 
I had to read that section several times before it was clear to me, so here’s the benefit of my blood, sweat and tears (and swearing). Note, this is for SW2005, so it may have changed a bit in SW2006.

In your drawing, right-click the note you want to link to the model file property, and select “Properties…” from the pop-up menu (near the bottom). This opens the Properties window.

On the right of the Properties window are 2 icons—select the one that has the hand pointing to a page with a chain link in the lower right. This icon opens the “Link To Property” window.

In the Link To Property window click the “Model in view specified in sheet properties” button. This opens up a list of the properties in your model. Select one and that links the note to that model property.

Note that the list of properties is reading the properties in the model file, so you need to define the properties in the model first.
 
Maybe I am not explaining myself properly.
I already know how to display the models customs properties in a drawing (as shown be the previous answers).
What I would like to do is copy or push that data from the model into a custom property setup in the drawing sheet template.
From what I can see this may need to be done with a macrofeature? Can anyone help us there?
Thanks.
 
I have done something similar. (I think). With a model in the drawing, link your format entities to all the model properties, then save as a template. The template is now searching for properties in the model, and as soon as a model is linked to the drawing the correct properties will show up.

Did I read you right?
 
andrewjohns ... perhaps a couple of screen shots would explain more about what you are trying to do.
See faq559-1100 or faq559-1177.

[cheers]
Helpful SW websites faq559-520
How to get answers to your SW questions faq559-1091
 
Ok, here's an undocumented trick though I don't know if it buys you anything different than just linking a note directly. You can create a property in the drawing "My Description" for example. Then put in $PRPSHEET:"Part Description" as the value. Then you can link notes on the drawing to this drawing property which is linked to the part property.

The custom property editor doesn't show the value of the link as you might expect, and I'm not sure there's any value to doing this, but maybe someone can come up with something.

Jason

UG NX2.02.2 on Win2000 SP3
SolidWorks 2005 SP5.0 on WinXP SP2
SolidWorks 2006 SP1.0 on WinXP SP2
 
There is little value in copying the model properties into drawing properties. That's why people couldn't understand what you wanted. Why would you like to do that?
 
I can see the value in this, especially when a PDM system is being used. For example, if you are pulling the drawing number and description fields into the title block from the referenced part/assembly and you do not also have these custom properties in the drawing file, you will not have these properties available when looking at previews of the drawing or when searching through the PDM system. You will also not see the description show up when you highlight the drawing file in Windows Explorer, nor will you get the description in the windows status bar (both very useful). In my opinion, it is best to have the description field in both places - part and drawing, which is what is being requested.

The best way to do this is to use a VBA form to enter/modify custom properties instead of using the SWX interface. This is very thoroughly discussed in the API help and there are numerous free custom properties routines available. You will need to modify one of these to accomplish what you are after. Then, you can enter properties as normal in part and assembly files, but when a drawing file is active your routine needs to:
1) get the first drawing view
2) activate the referenced document
3) get the properties you want to transfer and store them in strings
4) return to the drawing document and update/create the corresponding custom properties in the drawing

In this way, model custom properties can drive drawing custom properties without manual retyping. A macro will do it and is a better solution than a macro feature.
 
Stoker,

Can you recommend a custom properties download that has a easy-to-use interface for someone inexperienced in API? I have been trying to accomplish what you have described for awhile. Haven't spent a whole lot of time on it yet.

Thx
 
Stoker, that is exactly what I am thinking of doing.
We do not have a dedicated PDM so I was thinking of linking the model properties to the drawing's properties, so that they are visible using windows explorer. Also I was thinking of using the data to auto populate the design journal.doc in the drawing file. A limitation I have found with the design journal if used in the model is that it is not configuration specific, and as we use configurations for similar parts then the design journal does not work for us. As each part or config has a seperate drawing file then I think I can get the design journal to work for us.

Seems like some programming is needed.
Thanks everyone for their help.
 
You may want to look though the links at . A couple of custom properties examples with source code can be found at and . Both of these examples do more than just simply enter/edit custom properties - they include extra features and in my opinion are far more complex than most people really need or want them to be. However, they are written to be generic and they do demonstrate a lot of tools which you may find interesting.

Unless you have a large number of users, the best solution is a standalone macro with a simple userform, all done in VBA. Use combo boxes to hold lists that the user can choose from and text boxes for text entry. When the routine first runs, you can test to see what type of document is open and then enable/disable fields as required to ensure that the correct properties are entered for that document type.

When the model library was active on the SolidWorks web site there was an excellent example in the API section. It was a very basic form to enter custom properties without any unnecessary extra features. This example is no longer available on the SWX site, but maybe you can email API support to see if they still have it. This would be a far easier starting point to developing your own routine. You would just have to customize the property names to your standards and add the code to copy the required properties from the part to the drawing file.
 
Here is a ling to a macro that I wrote a while back for this purpose.

You run it from a drawing and it lets you copy the Number and Description properties between a model within the drawing and the drawing.

Brief instructions:
The dropdown to let you select between different models within the drawing.

The radio button lets you select between interacting with the model’s properties or the specific configuration’s properties.

The arrows transfer the number, description or both between the drawing and the model.

You are welcome to try it. I do not know how much luck you would have modifying it to interact with the design journal, and unfortunately I have not gone back through and commented the source code.

I found the source code for PropertyEditorSpec at helpful when writing this macro, and it might be a better starting point for creating your own.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor