Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

File properties (Custom) 1

Status
Not open for further replies.

J-C

Mechanical
Sep 8, 2003
1,066
Help mentions you can add custom properties through Windows explorer (Right-click / Properties / Custom) and they will show up as Part Attributes in UG. This doesn't seem to be the case though.

What I want to do is enter the "description" as a custom property for both the Model and Drawing file without having UG open. Plan to do it with a VB program that accesses both file's custom properties. Then in UG the description in the title block would be linked to the property(attribute).

Upon check into our PDM (Matrix), it would automatically extract this into the database for both Drawing and Model object types.

Any idea why this doesn't work as the help suggests?

Jason Capriotti
Smith & Nephew, Inc.
 
Replies continue below

Recommended for you

Jason,

I'm wondering this thing too.
You seem to need link Model and Drawing attributes and so do I.It's one of the biggest wishes after getting use to how SolidWorks handles them.Let's see what next week brings when NX3 gets installed.Maybe I still have to find or let someone write program to synchronize attributes.

Henry Mägi,
RM-tools
 
If someone could do that, I think it would be benefitial to almost everyone here. The ability to sync attributes from part to drawing could be of great use to us all. If someone were to write a UG Open or better yet .net program to do this, and post it here, I gaurantee you would earn a star ;-)

-Derek
DL Engineering Services

specializing in CAD Design Consultation Services
 
Using the master model of separate model and drawing files, model part attributes are brought into the drawing file as object attributes.


"Wildfires are dangerous, hard to control, and economically catastrophic."

Ben Loosli
CAD/CAM System Analyst
Ingersoll-Rand
 
Ben,

will those attributes in drawing file get updated?

Henry
 
The attributes themselves should get updated. Depending on how you put them on the drawing, they may or may not. If you place them on the drawing as string text from the attribute through a GRIP program, they won't update until you run your program to update the drawing. If you use the newer, since V16, method of referencing the attribute, they will.


"Wildfires are dangerous, hard to control, and economically catastrophic."

Ben Loosli
CAD/CAM System Analyst
Ingersoll-Rand
 
Ben,

thanks for explanation.There really is method of referencing part attributes.However in my opinion you have to get those attributes to the non-master drawing manually every time.
On different drawings you get different attribute notes for same master file:
<W!8225@HRC>
<W!49383@HRC>
What next?Create GRIP or VB code to fill title block with selected part attributes?

Henry Mägi
 
We do it with a GRIP program, but we are on V18, so no drawing templates. The GRIP program checks attribute entry for length and capitalizes them all for the drawing.


&quot;Wildfires are dangerous, hard to control, and economically catastrophic.&quot;

Ben Loosli
CAD/CAM System Analyst
Ingersoll-Rand
 
Aikon, I have a grip program that does what Ben describes. It calculates the weight and volume of the part, assigns those values to attributes, then creates a note in the drawing file (master model) that references the attributes to update automatically.

The program names the solid chosen (we'll call it 'MYSOLID') then assigns the calculated weight value to an attribute named 'PW' (part weight). The note then looks like this: 'PART WEIGHT : <WMYSOLID@PW>'. Whenever the weight attribute is updated (whenever the program is run again) the note will automatically update to the new value.

I hope this helps.
 
Cowski,
Any chance of posting the source for that Grip program, for those of us who are not Grip developers, but really like the power and convenience of those tools?

-Derek
DL Engineering Services

specializing in CAD Design Consultation Services
 
You can quickly try it out for yourself with interactive commands. In your part file go to Edit -> Properties then assign the solid of interest a name (on the general tab) and any desired attributes (on the attribute tab). Then make your master model drawing then go to drafting and place a note with the annotation editor.

For example, I have a model of a retaining ring; I named it RING and gave it an attribute MATL with the value STEEL. In the drawing I would place a note with this text: "MATERIAL: <WRING@MATL>". The note would read "MATERIAL: STEEL" and would automatically update when the attribute changes. Note the "W" before the name, this is important.

If/when I get a few free minutes I'll try to post a short grip demo, but right now things are a little busy and the program that I have is fairly long (it does more than just assigning attributes) and it might be difficult to pick out the bits you are interested in.
 
CAn you link a note to an attribute using the master/non-master model approach? Our drawings are separate files from the model.

Jason Capriotti
Smith & Nephew, Inc.
 
Yes, that is exactly what I was describing in the previous post. Give it a try.
 
Jason,

You can link Attribute from Master model with non-Master drawing:Drafting,Annotation editor,Annotation editor,Relationship,Object Attribute,now put cursor on needed modelview,hold on just a second until selection box comes out,from it select :(master file name).Choose needed attribute.It's gone be something like this: <W!10023@ATTRIBUTE_NAME>.Number inside is going to change after opening file afterwards but attribute is linked.
Big question stays:how can we make drawing templates if this number changes all the time? Use PDM? Use GRIP or VBA to update annotations in drawing with new number? "The truth is somewhere out there" :)

Henry
 
"how can we make drawing templates if this number changes all the time?"

Refer to my previous post, choose a common name for your parts (e.g. 'MODEL') then you can put notes in your templates like <WMODEL@ATTRIBUTE>. As long as you are consistent with the name, it will pull in the correct information.
 
cowski, I don't see how that works, could you elaborate?

Jason Capriotti
Smith & Nephew, Inc.
 
Gildashard,
The method I describe won't do anything for the custom (right click) file properties that you describe in your first post; but it does allow attributes to be transferred to the drawing (whether it is master model or not). This seems to be what you were referring to in your first post and the question was directly raised by others in subsequent posts.

In Unigraphics you can name objects so that you can refer to them by that name later. For instance the delete command or trim body command (among others) will let you type in a name rather than picking with your cursor. If you name your solid model and assign attributes to it you can refer to it by name rather than some system generated number in the linked attribute note. So, if I name my solid model 'MODEL' and assign attributes to it I can put a note on my drawing <WMODEL@ATTRIBUTE> and it will show the attribute associated with the solid. If you are doing piece part drawings you can pick a common name ('MODEL') and use it in your template. If, however, you are doing multiple part assembly drawings and want to use these linked notes, the parts will probably have to have separate names (the linked notes I use are only for single part drawings so I have not had problems, but I assume it would cause problems for multiple part drawings).

I hope this solves the problem.
 
Hello cowski,

I try to create my templates according the way you do, but it doesn't work.
I doesn't allow me to create this annotation, it is an invalid annotation.

I think I do something wrong here ...
 
My apologies, you cannot use an attribute in a note if there is nothing to link it to (as in an empty template drawing). I have been spoiled by our grip program which creates the notes and places them after the drawing has been created. Sorry for the confusion.
 
For demco (and anyone else interested) here is a small grip demo to do linked attribute notes.



Code:
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$ DEMO PROGRAM TO SHOW HOW TO LINK ATTRIBUTES TO DRAWING NOTES
$$ 
$$ USAGE: RUN THE PROGRAM IN MODELING, PICK THE SOLID YOU WANT TO ASSIGN
$$ 	A MATERIAL ATTRIBUTE TO, IN THE TEXTBOX THAT COMES UP ENTER THE
$$	MATERIAL. MAKE A DRAWING FILE AND ADD YOUR SOLID TO IT, SWITCH TO
$$	DRAFTING AND RUN THE PROGRAM AGAIN, IT WILL PLACE A LINKED NOTE
$$	ON YOUR DRAWING. SWITCH BACK TO YOUR MODEL AND RUN THE PROGRAM AGAIN
$$	(IN MODELING) ENTER A DIFFERENT VALUE FOR THE MATERIAL. SWITCH BACK
$$	TO YOUR DRAWING, THE NOTE HAS UPDATED AUTOMATICALLY (IT IS LINKED TO
$$	THE ATTRIBUTE, NOTICE YOU DID NOT HAVE TO RUN THE GRIP PROGRAM
$$	AGAIN TO UPDATE THE NOTE).
$$
$$ PROGRAMMED BY JEFF GESIAKOWSKI
$$ 10-15-2004
$$ 

$$ VARIABLE DECLARATIONS
$$	SOLID1 - ASSIGN ATTRIBUTES TO THIS SOLID
$$	MATL(2,132) - TEXT ARRAY FOR USE IN ASSIGNING THE ATTRIBUTE
$$	  MATL(1,132) - ATTRIBUTE TITLE
$$	  MATL(2,132) - ATTRIBUTE VALUE

ENTITY/SOLID1
STRING/MATL(2,132)

$$ IF WE ARE IN A DRAWING, UPDATE THE DRAWING NOTE
IF/(&DSTATE==2 AND &CURLAY=='!DRAWING'),JUMP/INDWG:

$$ MASK SELECTION FOR SOLIDS ONLY
MASK/70

$$ PROMPT FOR USER SELECTION OF SOLID
IDENT/'SELECT A SOLID TO ASSIGN ATTRIBUTES',SCOPE,WORK,SOLID1,RESP
$$ IF USER HITS CANCEL, END PROGRAM
IF/RESP<=2,JUMP/RESET:
$$ NAME THE SELECTED SOLID 'MYSOLID'
&NAME(SOLID1)='MYSOLID'

ASKMATL:
$$ PROMPT USER TO ENTER MATERIAL FOR SOLID
$$ STRING ENTERED WILL BE STORED IN MATL(2)
TEXT/'ENTER MATERIAL NAME',MATL(2),MRSP
IF/MRSP==1,JUMP/ASKMATL:	$$BACK
IF/MRSP==2,JUMP/RESET:		$$CANCEL
IF/MRSP==3,JUMP/ASKMATL:	$$NO TEXT
$$IF/MRSP==4,			$$ALT ACTION, NOT USED HERE

$$ ASSIGN ATTRIBUTES TO THE SOLID
$$ FOR USE IN THE DRAWING FILE
MATL(1)='MATERIAL'
$$ MATL(2) CONTAINS THE VALUE ENTERED ABOVE
ASATT/SOLID1,MATL(1),MATL(2)

$$ JUMP OVER DRAWING NOTE CREATION (WE ARE IN MODELING AT THIS POINT)
JUMP/RESET:

$$ IF THE PROGRAM JUMPS TO HERE, WE ARE IN THE DRAWING
$$ AND NEED TO PLACE THE NOTE
INDWG:
$$ ADD NOTE AT COORDINATE (5,5); CHANGE THIS TO SUIT YOUR NEEDS
NOTE/5,5,'MATERIAL: <WMYSOLID@MATERIAL>'
JUMP/RESET:

$$ RESET SYSTEM VARIABLES, JUMP HERE IF USER CANCELS
RESET:
$$ NO SYSTEM VARIABLES HAVE BEEN ALTERED IN THIS PROGRAM
$$ IF THEY WERE; WE WOULD RESET THEM HERE


HALT
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor