cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

How do you drive a Creo Parametric Part (.prt) parameters/attributes from file using a text file? Pro Program? Something else?

Highlighted

Re: How do you drive a Creo Parametric Part (.prt) parameters/attributes from file using a text file? Pro Program? Something else?

Hi, Teun,

What the EXECUTE statements are doing exactly? That's the only part I didn't understand.

Thank you,

Nic.

PS. Do you have any experience with Drawing Program? I opened a new question about that here:

Drawing Program User Guide, Tutorial and Hands-On Workshop

Highlighted

Re: How do you drive a Creo Parametric Part (.prt) parameters/attributes from file using a text file? Pro Program? Something else?

EXECUTE

This is for assemblies to link assy input variables to program variables in assembly components.

EXECUTE {PART}/{ASSY } name or variable

input variable of design at next lower level = expression

input variable.....

END EXECUTE

Only reaches one level, but that level can domino to the next.

Can be used with IF-ELSE-ENDIF

For example

Let's say we have an assembly with a part called "MyComponent".


Assembly (asm)

|  MyComponent (prt)

The "MyComponent" has an INPUT parameter called "MY_LENGTH" which is a NUMBER.

Inside the pro/program of te assemby, after the RELATIONS, you can write

EXECUTE PART MyComponent

MY_LENGTH = 100

END EXECUTE

This will set the parameter "MY_LENGTH" of "MyComponent" to 100.

You can replace the 100 with a parameter of your own.

As for the DRAWING PROGRAM.

You create DRAWING STATES in the drawing, then active those DRAWING STATES with the drawing program.

A DRAWING STATE can hide/show dimenions or views for example.

IF HIDE_SECTION_VIEW == YES

SET STATE DONT_SHOW_SECTION_VIEW

ENDIF

HIDE_SECTION_VIEW is a parameter from the part/assembly

DONT_SHOW_SECTION_VIEW is a DRAWING STATE created in the drawing (which hides the section view)

Highlighted

Re: How do you drive a Creo Parametric Part (.prt) parameters/attributes from file using a text file?  Pro Program?  Something else?

Wow, Teun!! You're a gold mine! Thank you.

May I dare two additional questions:

1. The {ASSY } in the EXECUTE is refered to a sub-assy in the main assy, I suppose, right? As you said it only goes down one level, I won't be able to EXECUTE an input form a part in the sub-assy of my assy. This is what I understood from your explanation. But that are ways to make it propagate further if you need.

2. In Drawing Program is it possible that several states are "active" at the same time?

For example:

I have an assy with:

- four languages for the drawing to choose from which I manage in Drawing Program with a block of view states called /* Language for example

- I could have from 0 to 4 holes for my assy and I manage this in Drawing program with a block of view states called /* Holes for examples

- I could have or not a Groove with or without chamfer and I manage this with a block called /*Groove and Chamfer for example

And all this are parameters in the INPUT block in Pro/PROGRAM.

How it works?

-English Set State English

-One Hole Set State One_Hole

-Groove without Chamfer Set State Groove_without_Chamfer

and there will be one over another.

And if I go the assy and change just the language parameter to French, the drawing will update only the language?

Something like that?

I am sorry for the over detailed questions, but for Drawing Program I couldn't find a Tutorial as I have for Pro/Program

Thank you very much again,

Nic.

Highlighted

Re: How do you drive a Creo Parametric Part (.prt) parameters/attributes from file using a text file?  Pro Program?  Something else?

1. Correct.

2. Yes, that should be possible

Please see attachment for an example

Highlighted

Re: How do you drive a Creo Parametric Part (.prt) parameters/attributes from file using a text file? Pro Program? Something else?

Yes!! Exactly! Thank you!

And I was thinking that I have to do a separate state for the holes too. But it's enough to manage the states with the pattern.

Is it possible to insert a custom symbol (the one in Annotate-Symbol-Custom Symbol) in a View State? All I could find in the Help was this:

To create detail items such as dimensions, notes, and balloon notes in a drawing state, choose Create from the DWG COMMANDS menu that appears when you click Tools > Drawing Program > Define States > Create State > Record Cmds. Items that you create in one state are not visible in any other state or outside of the drawing program

which doesn't refer to Symbols but Dimensions, Notes, Balloons.

I mean, instead of your example of "THIS IS AN ENGLISH NOTE" note to have a Custom Symbol for every language used free ("this is a note" symbol) or attached to a dimension/surface ("this is the oil groove" attached to the dimension of the groove "36" or an edge of it. So, no groove-no symbol, changed language- changed language of the symbol)

Nic.

Highlighted

Re: How do you drive a Creo Parametric Part (.prt) parameters/attributes from file using a text file? Pro Program? Something else?

Hi Teun,

I have downloaded nalexandru.zip‌ file you have attached for the given reference. I am looking changed value by entering through program>Edit Design> Yes> Enter value for Length. Model is updating but drawing file not.

Can you please guide me for that.

Thanks in advance!!

Highlighted

Re: How do you drive a Creo Parametric Part (.prt) parameters/attributes from file using a text file?  Pro Program?  Something else?

Hi, Anu,

Did you updated from the drawing file? Maybe you should refresh the views?

Cheers,

Nic.

Highlighted

Re: How do you drive a Creo Parametric Part (.prt) parameters/attributes from file using a text file? Pro Program? Something else?

Impressive... like your idea

Highlighted

Re: How do you drive a Creo Parametric Part (.prt) parameters/attributes from file using a text file? Pro Program? Something else?

Although not as detailed an answer as some of the previous ones, please take a look into External Analysis.  I have used it in the past to successfully read in customers' pre-existing algorithms/calculation results.  I usually modify the program to produce repeatable output (csv works well), then read the results into a part/assembly, pulling out whatever its needed. The results are fairly easily accessed from the analysis feature.  Depending on your needs, the analysis feature can exist anywhere in the model tree where you can hopefully avoid multiple regenerations.

Highlighted

Re: How do you drive a Creo Parametric Part (.prt) parameters/attributes from file using a text file? Pro Program? Something else?

You could also use an external program like Model Processor (free Guest version). It has an action to solve specfically this topic. http://mp.inneo.com , register , download , use. (only >= WF 4, better >= Creo 2.0) this shouldn't be seen as advertising so the guest mode is free and should solve the task.

Br,

Eike

Announcements
Message from Brian Thompson (PTC General Manager and DVP) regarding Creo Business Continuity plans.