×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Pro/Program: swapping components in an assembly

Pro/Program: swapping components in an assembly

Pro/Program: swapping components in an assembly

(OP)
Hey Guys
Need some quick help in CREO relations and Programing.
I have a assembly of pulleys and all these pulleys part number changes according to the load. On input and the pulley changes.
Im not able to figure out the relation and editing of the program. Pulleys are in family instances. Kindly help.

RE: Pro/Program: swapping components in an assembly

About Pro/PROGRAM
Each model in Creo Parametric contains a listing of major design steps and parameters that can be edited to work as a program. By running the program, you change the model according to new design specifications.
To enter the Pro/PROGRAM environment, click Model > Model Intent > Program.

The WHICH DESIGN Menu
Initially, you can gain access to only a design listing that exists in the model. However, whenever you edit a listing, a file is created that contains the latest design specifications. At this point, two design listings exist for the same model, From Model and From File. After you successfully incorporate design changes in the model, From File is deleted, and only From Model is available.
In those cases where a From File design listing exists, the WHICH DESIGN menu displays two commands:
• From Model—Retrieves a design listing built in the model.
• From File—Retrieves a design for a model from an existing file named assemblyname.als or partname.pls.
Note:
From Model reflects the current state of the model, while From File includes all new instructions that you have added during the last editing session.

To Incorporate Changes in the Model
After you finish editing a Pro/PROGRAM listing, the system prompts you to specify whether you want to incorporate the changes in the model. To proceed, click Yes. If you click No, the program is not executed.
If you want to run the program at any point, open a listing using the Edit Design command. Exiting the editor (no changes need to be made) starts the program.
In order to incorporate the changes in the model, the system may prompt you to enter variables.
Note:
After changes are incorporated in the model, a design file is deleted; only From Model is available for viewing, editing, or executing.

Entering Input Variables
When a model design has input variables, the system prompts you to enter their values whenever you regenerate the model or incorporate new instructions in the model. You can enter data using the following commands on the GET INPUT menu:
• Current Vals—When you run the program, it uses the current values without requesting your input.
Note:
If you want to check the current parameter values, choose Show Design > From Model. The information window displays the listing with the input variables and values assigned to them in the current model design.

• Enter—Enter new input values as prompted. Check boxes in the INPUT SEL menu control parameter selection. Pro/PROGRAM only prompts you to enter a new value for the checked parameters.
• Read File—When running a program, the system uses input from a file. Type a file name (including the extension, if any).

To Select or Modify Input Parameters
1. Click PART > Program, and then click PROGRAM > Edit Design. The system editor displays the current program for the model.
2. Edit the program input list.
3. Incorporate your changes into the model.
4. Click GET INPUT > Enter.
5. In the INPUT SEL menu, click the check boxes next to the input parameters for which you want to enter values, and then click Done Sel.
6. Enter the values as prompted in the message area.
7. Click PROGRAM > Done/Return.
Input from a File
Instead of entering variables manually, you can enter them from a file located in the current directory using Read File. The input file must have one input per line, formatted as follows:
param_name = value or expression
For example:
THICKNESS = 2.5
INCLUDE_VALVE = YES
MATERIAL = "STEEL"
If you enter parameters from a file that contains fewer parameters than are called for in the INPUT statement, the system assumes current values for the missing parameter.
If, on the contrary, the output file contains more variables than are needed for the execution, those parameters not pertaining to the program are disregarded.
Because the program ignores those parameters that do not pertain to this particular program, you can create an input file that acts as a global source for a number of models.
Note:
The system is case-sensitive when parameters and their values are read in from a file. Be consistent in specifying variables.

To Create a Part or Assembly Instance Programmatically
Parts and assemblies created programmatically with input parameters can be turned into instances of the generic model.
Whenever a design has been executed, either after regenerating the model or after editing the design, you can create a family instance of that specific configuration using the Instantiate command on the PROGRAM menu.
1. In an open part or assembly, click Model > Model Intent > Program.
2. On the PROGRAM menu, click Instantiate. Pro/TABLE appears with the name of the generic model or models (part in Part mode, assemblies and parts in Assembly mode) in column 1, and the default instance name or names in column 2.
3. Edit the default instance name or names for assembly and parts if desired, and then exit Pro/TABLE.
After you create an instance assembly, you can view the family table. It now includes the instance assembly name, part names that were executed, and variables that were entered during input.
Note:
The parameters that appear in the family table control the model design.
Instantiating a model revises your design program slightly. For example, if an assembly program had an EXECUTE statement, an IF statement is created about the EXECUTE statement. This validates execution only for a generic assembly.

About Editing the Model Design
By editing a design, you make changes to a model.
Although the editor permits you to make other changes (changes not discussed in the following topic) in the design, it ignores these changes upon execution. Only those discussed in the following topic are actually changed in the design.
For example, if a feature attribute was changed from THRU ALL to THRU NEXT, the attribute that appears in the model after execution is THRU ALL.
To edit a design, click PROGRAM > Edit Design. If two designs exist for the model, you must choose From Model or From File from the WHICH DESIGN menu.
Note:
When you edit your design for the first time, or after you have successfully incorporated changes in the model, the WHICH DESIGN menu does not appear. In these cases, the design is edited only From Model.

A warning appears when you attempt to edit From Model while a file with a Pro/PROGRAM listing exists in the working directory. This warning reminds you that when you exit from the editor the file will be overwritten with the new contents. If you still want to proceed with editing (this replaces an old design file), enter Y. To abort editing, enter N.
If you are working with an assembly that has components belonging to a family table, listings for instances may be viewed, but they cannot be edited, because the program always resides in the generic part.
Note:
To gain access to the listing in a generic assembly, assembly instances must be cleared from workstation memory.

Relations
All relations valid in a Creo Parametric model can be entered in a Pro/PROGRAM design.
If an expression you want to include in the RELATIONS statement contains more than 80 characters, use a backslash (\) to interrupt the current line and continue the expression on the next line.
The format can be as follows:
RELATIONS
PARAMETER = COVER_SIZE/2 + LENGTH*0.75 -\
0.75*d3*d3 + THICKNESS*2
END RELATIONS
Changing the material density in a part causes the system to update the mp_density value in relations and vice versa.
Note:
• When using negative dimensions, a dollar sign ($) must precede the dimension symbol in both the input statement and the external input files. For example, use $d20 instead of d20. The dimensions will not be updated if a dollar sign does not precede the symbols.
• If the program assigns a value to a dimension variable that is already driven by a part or subassembly relation, two error messages appear. Edit or remove the program relation and regenerate.

Using Comments to Annotate Relations and Features
You can use comments in the program to annotate relations and features. To insert comments, use the following format:
/* < your comment
Note that the slash and asterisk precede the comment. Also, the comment on a feature must immediately follow its ADD FEATURE line. The comment is then attached to the feature being added and appears in the information window.

About Input Parameters and Prompts
INPUT variables may be specified at the beginning of the listing. A typical use of an INPUT variable is to supply a value for a dimension. This is a parameter later used in a relation or as input for model names used in assemblies.
Input Parameter Types
The INPUT statement must indicate the name and type of the variable. Variable names must always begin with a character.
The following variable types are supported:
• Number—Enter a number for this variable type.
• String—Enter a string of characters for this variable type. This enables you to enter parameters or model names, but not user attributes.
• YES_NO—Enter either Y or N for this variable type.

Customizing Prompts for Input Variables
Whenever input is required, the system prompts you to enter the value of the input variable. Instead of using the system prompts, you can customize prompts for particular input variables. Then, during design execution, the prompts appear when the associated variable requires input.
The rules for including prompts follow:
• A prompt must be enclosed in quotation marks.
• A prompt must immediately follow the corresponding input variable.
For example:
INPUT
THICKNESS NUMBER
"Enter wall thickness for the cylinder"
INCLUDE_VALVE YES_NO
"Is valve to be included for analysis"
STOCK_ID STRING
"Enter the part’s stock ID"
...
END INPUT
Deleting Input Lines
If an input variable is deleted from the design or its name is changed, the relations and conditions that use it do not become invalid automatically. The old variable name remains in the list of parameters of the model and needs to be deleted explicitly using the Del Param command.

Conditional Input Statements
The input list in Pro/PROGRAM can include IF - ELSE - ENDIF statements. When an IF condition evaluates to FALSE, you are not prompted to enter the input values.
For example:
INPUT
INCLUDE_HOLE YES_NO
"Should the hole be included?:"
IF INCLUDE_HOLE == YES
HOLE_DIA NUMBER
"Enter diameter for hole"
ELSE
...
ENDIF
...
END INPUT
When executing this program, you are prompted to enter the diameter of a hole only if a hole feature is included.

About Design Branches
Conditional statements can be used to create a design branch, enabling you to control whether a feature or component is included in the design.
For example, if the original Part design was:
ADD PROTRUSION.....
ADD HOLE.....
ADD CUT.....
The modified design might look like this:
ADD PROTRUSION.....
IF d1 > d2
ADD HOLE
...
END ADD
ENDIF
ADD CUT.....
END ADD
Conditional statements are also valid for assemblies. They control whether a particular part or subassembly is added to the assembly or executed. In the following example, PART_B is not used unless the parameter DIA has a value less than or equal to 1.25.
ADD PART BASE_1
....
IF DIA > 1.25
ADD PART PART_A
.....
END ADD
ELSE
ADD PART PART_B
.....
END ADD
ENDIF
Creo Parametric reevaluates any Pro/PROGRAM feature conditional statements (for example, IF statements) before regenerating each feature. As a result, only a single Regenerate command is needed for a design in which Pro/PROGRAM feature conditional statements are changed by Evaluate features and reference dimensions.
However, if you add to a design a Pro/PROGRAM feature conditional statement that is changed by a later feature, the system provides an error message that the design is now inconsistent.

Other Variable Types in IF Statements
All variable types may be included in IF statements. Notice that string values must be enclosed in quotation marks.
For strings:
IF MATERIAL == "STEEL"
d2=10
ENDIF
For YES_NO:
IF DRAFT==YES
d25=5
ENDIF

About Replacing Components in Assembly Designs
You can set up a program to replace assembly components with interchangeable components. Interchangeability is established using interchange groups, members of the same family table, or assembly layout declarations. The member named when executing the design must be interchangeable or else the execution quits and previous values are kept.
You can set up a program that interchanges components through an INPUT statement structure or through a RELATION statement. When the feature of a parameter belongs to an assembly or to another component, an ADD COMPONENT statement or relation must include the component ID.
The format for assembly relation is:
XYZ = <parameter_name>:fid_<feature_name>:<comp_id>
OR
XYZ = <parameter_name>:fid_<N>:<comp_id>
where <comp_id> is the component ID in the assembly of the referenced part. To determine the component ID (<comp_id>) in Assembly mode, click Model > Relations and insert a parameter using . The component ID and the parameter are displayed in the Relations dialog box.

To Interchange Components Programmatically
1. Include a string variable in the INPUT statement in an Assembly design.
For example:
INPUT
fastener_name STRING
"Enter name of fastener to be used in cam:"
END INPUT
2. In the associated ADD statement, put the name of the string variable in parentheses.
For example, to add a part specifically to the assembly:
ADD PART (fastener_name)
...
END ADD
3. To interchange a part named washer for a subassembly or vice versa, use an ADD COMPONENT statement, using this format:
ADD COMPONENT (name with an extension, or variable)
COMPONENT ID <component Id>
For example:
ADD COMPONENT washer.prt
COMPONENT ID 4
...
END ADD

To Interchange Components Using Relations
1. In the INPUT statement, include a YES_NO variable.
For example:
INCL_CRANK YES_NO
2. Add an IF_ELSE clause in the RELATIONS.
For example:
RELATIONS
IF (INCL_CRANK == YES)
PART_NAME = "CRANK"
ELSE
PART_NAME = "SHAFT"
ENDIF
END RELATIONS
The ADD statement includes the variable defined in the ADD statement (it is enclosed in brackets).
For example:
ADD PART (PART_NAME)
...
END ADD

To Replace Family Table–Driven Components
You can automatically replace family table–driven components according to design criteria by using the lookup_inst function. With this function, you can search a component family table to find an instance that fits the values of the search parameters. If the lookup function does not find a match, it returns the name of the generic.
The format for lookup_inst is:
lookup_inst ("generic_name", match_mode, Òparam_name_1Ó, match_value_1, Òparam_name_2Ó, match_value_2,...)
where
• generic name—Name of the generic model with a prt or asm extension
• match_mode—One of the following values:
◦ –1 (find closest instance with param values less than or equal to supplied values)
◦ 0 (find instance with param values that match supplied values exactly)
◦ 1 (find closest instance with param values greater than or equal to supplied values)
• param_name_1—Family table parameter name
• match_value_1—Value to match against

Example: Replacing Family Table-Driven Components
Given an assembly that consists of a block and a peg, assemble the instance that matches the diameter of the hole in the block.
inst_name = declared string parameter initialized to generic part name
generic_name = peg.prt. This part contains a number of instances based on diameter dimension (d) and length dimension (d1).
Family instance names of peg.prt include:
2 x 4 - d0 = 2, d1 = 4
2 x 5 - d0 = 2, d1 = 5
2 x 6 - d0 = 2, d1 = 6
3 x 4 - d0 = 3, d1 = 4
3 x 5 ............
3 x 6 ............
Add a relation to the control in which peg.prt is added to an assembly controlled by dimensions of a feature in block.prt. The relation is:
inst_name = lookup_inst ("peg.prt", 0 , "d2", d6:0, "d1", d5:0 +1)
In this way, the instance of peg.prt being assembled to blockpeg.asm is controlled, based on the dimensions of the hole in block.prt.
The Pro/PROGRAM listing would look like this:
INPUT
END INPUT
RELATIONS
INST_NAME = LOOKUP_INST ("PEG.PRT", 0, "D2", D6:0, "D1", D5:0 + 1)
END RELATIONS
ADD PART BLOCK
INTERNAL COMPONENT ID 1
END ADD
ADD PART (INST_NAME)
INTERNAL COMPONENT ID 2
PARENTS = 1 (#1)
END ADD
MASSPROP
END MASSPROP

To Replace User-Defined Features Using Pro/PROGRAM
After you set the group_repl_with_recycle configuration option to no, you can programmatically interchange user-defined features using a CHOOSE statement:
CHOOSE (<variable name>)
where <variable name> is the name of a string variable that contains the ID of the group to be placed. All the available IDs can be found in the ADD statement of the leader of the currently active group in the Pro/PROGRAM listing.

Example: Replacing User-Defined Features
INPUT
GROUP STRING
"ENTER GROUP TO PLACE 300/352/409"
END INPUT
CHOOSE (GROUP)
Note:
• To use a CHOOSE statement, you must first manually replace a family table instance of the group or replace the group with another group.
• CHOOSE statements cannot be included in conditional statements.

The group leader’s ADD statement could look like this:
ADD FEATURE (initial number 4)
INTERNAL FEATURE ID 300
PARENTS = 33(#1)
TYPE = PROTRUSION
FORM = EXTRUDED
SECTION NAME = S2D0002
DEPTH = FROM SKETCH TO BLIND
FEATURE’S DIMENSIONS:
d44 (d23) = 2.00
d45 (d24) = 1.00
d46 (d25) = 1.00
d47 (d26) = 2.00
d48 (d27) = 1.00
MEMBER OF A GROUP, NAME = RECT
LEADING FEATURE OF THE GROUP: ID = 303
LAST FEATURE OF THE GROUP: ID = 303
GROUP IS REPLACEABLE BY FEATURES ID (NAME):
409(round) and 352 (circular)
END ADD

Using EXECUTE Statements in Assembly Listings
EXECUTE statements are valid for assembly listings only. They provide a link between input variables in an assembly and input variables for programs in parts and in the subassemblies that make up the assembly.EXECUTE statements follow this sequence:
EXECUTE {PART} name or variable
{ASSY }

input variable of design at next lower level = expression

input variable.....

END EXECUTE
Similar to an ADD statement, an EXECUTE statement can be used in the format EXECUTE COMPONENT to interchange parts and assemblies. When specifying the component, make sure to use its extension (prt or asm).
Note:
When you are running a program, each part can be executed (that is, each part can receive variable values through an EXECUTE statement) only once. Avoid including conflicting instructions.

Hierarchy of Assembly Execution
Assemblies can execute subassemblies, which in turn can execute other subassemblies. The parts that compose a subassembly are not executed by the main assembly but are instead executed by the subassembly. Only the next level down in an assembly is executed by the assembly design.

Transferring Input Values from the Upper-level Assembly
The input variables are used to transfer input data from the upper-level assembly to the appropriate parts and subassemblies to drive the creation of the model.
For example, for the part block_base, the listing looks like this:
INPUT
key_size
ansi_thread
...
END INPUT
RELATIONS
d5 = key_size
d3 = depth * 1.25
END RELATIONS
....
Then the design listing for the assembly looks like this:
INPUT
hole_diameter NUMBER
thread_type STRING
depth
...
END INPUT
RELATIONS
END RELATIONS
EXECUTE PART block_base
key_size = hole_diameter/2 + 0.025
ansi_thread = thread_type
depth = DEPTH
...
END EXECUTE
And the design for the part block_base looks like this:
INPUT
ADD FEATURE.....
Note:
• The parameter key_size appears in the EXECUTE statement for the assembly and the INPUT statement for the part. This is necessary for the parameter value to be passed down from the assembly to the part. If the parameter does not appear in both places, or no EXECUTE statement is in the assembly design for the part, then those values that are currently in memory are used for the part.
• The parameter thread_type is set equal to ansi_thread in the EXECUTE statement, which is then passed to the part through the INPUT statement.
• The parameter depth is set equal to DEPTH in the EXECUTE statement and passed to the part using the same name in the INPUT statement. This technique is often preferable to step 2 because it is easier to keep track of the parameters.
• The relation d5 = key_size is not necessary. The parameter symbol d5 can instead be renamed key_size using the Symbol command in the DIM COSMETIC menu.

Specifying a Part to Execute in an Assembly Program
When you are using an assembly program to replace a part in the assembly using interchangeability records, you can make sure that the appropriate part program is executed by entering the part name as a variable in the EXECUTE statement. This operation is similar to using a variable in anADD PART statement.
For example, an assembly program could look like this:
INPUT
COMPONENT STRING
"Enter part name"
DIAMETER NUMBER
END INPUT
....
EXECUTE PART (COMPONENT)
d1=DIAMETER
END EXECUTE
If an EXECUTE statement passes values to variablesA and B, and an INPUT statement declares only the variable A, the following occurs:
• A warning message informs you that the variable B has not been defined. You can then edit your design to correct the error.
• If you incorporate changes in the model after ignoring the warning, the value of A is passed to a parameter with the same name in the part being executed.

Using EXECUTE Statements inside IF-ENDIF Statements
EXECUTE statements can be used inside IF-ENDIF statements as a way to avoid execution of the lower-level model, unless necessary. If not executed, the current values of the model are used.
For example:
INPUT
key YES_NO
"Does the assembly have a key (Y/N):"
IF key == YES
key_name STRING
"Enter key name:"
ENDIF
END INPUT
RELATIONS
END RELATIONS
IF key == YES
EXECUTE PART (key_name)
END EXECUTE
ENDIF
The part keyname is executed only if it is included in the assembly.

Updating Mass Properties When Geometry Changes
Use the MASSPROP statement to update mass properties each time geometry changes. After you have specified parts or assemblies for which mass properties are to be updated, you can request the current value of a required parameter through the relations mechanism.
To update mass properties, use the following format:
MASSPROP
PART NAME
ASSEMBLY NAME
END MASSPROP
Note:
When specifying the model for which mass properties are to be calculated, enter the model name without an extension.

The MASSPROP statement can contain the IF... ELSE clause. If you add a condition to the MASSPROP statement, the mass properties of an object will be calculated only if that condition is met.
For example:
MASSPROP
IF THICKNESS > 1
PART PLATE
ELSE
ASSEMBLY BLOCK
ENDIF
END MASSPROP
In the preceding example, if the parameter THICKNESS is more than 1, mass properties is recalculated for the part PLATE; otherwise, mass properties for the assembly BLOCK is calculated.

Using INTERACT Statements as Place Holders
INTERACT statements provide a placeholder for creating interactive part and assembly features. They can be inserted anywhere within the FEATURE ADD - END ADD or PART ADD - END ADD statement.
For example, the ELSE statement in the previous example could have been constructed as follows:
ADD PROTRUSION.....
IF d1 > d2
ADD HOLE.....
ELSE
INTERACT
END IF
ADD CUT.....
In this example, an alternate set of features is to be created if d1 is not greater than d2.
Interact mode works similarly to Insert mode accessed from Creo Parametric.
Executing an INTERACT Statement
When the system encounters an INTERACT statement in the program, the execution of the program is interrupted. At this point, you can add new features. Also at this point, the system displays an incomplete model built up according to the last instruction before the INTERACT statement. In Interact mode, the model is frozen and cannot be modified.
After you are in Interact mode, select any feature you want to add from the FEAT CLASS menus and proceed to specify all required parameters. After you have created a new feature, the system asks whether you want to continue adding features. If you answer N, program execution resumes. After execution is completed, any new features added within the INTERACT statement replace the INTERACT statement in the model design.
Note:
You can quit interacting immediately after the program moves into the INTERACT phase (before you start to create features). Choose Done/Return from the FEAT CLASS menu and answer N to the system prompt asking if you want to continue. The program resumes execution and proceeds to the end.

To Suppress Part or Assembly Features
1. To suppress a part or assembly feature or components, add the word SUPPRESSED immediately following the word ADD:
ADD SUPPRESSED PROTRUSION
2. To resume a suppressed feature, delete the word SUPPRESSED from the ADD FEATURE clause.

from http://portal.ptcuser.org/p/fo/st/topic=3&post... (external link)

Guilherme Rocha
RE: Family Table Children
June 14, 2010 02:19 PM (in response to Payton Schirm)

I am not sure if this is what you are looking for but you can use PRO/PROGRAM to replace a generic/instance part with other that meets some or a unique parameter for example, sorry about the mess of information I’ve made here, I hope you get it, I could not find the right files of this example to send you so I hope you can reproduce it.
Below you can see the family table of the part 333.prt. The names of the instances can´t be used to determine the correct instance to be loaded in the assbembly, but the dimensions X and Y define wich one will be used.

1. ! Generic part name: 333
2. ! Name d1 d0 d4
3. ! X Y Z
4. ! ==================================================
5. ! GENERIC 3.5 3.0 1.0
6. 431 4.0 3.0 1.0
7. 121134-1 4.0 10.0 2.0
8. 541 5.0 4.0 1.0
9. TEST_PART 8.0 1.0 1.5
10. 651 6.0 5.0 1.0
11. JOE_INST 7.0 10.0 2.0
12. SPEC_2 2.0 4.0 1.0
13. 890-1 8.0 9.0 1.0
14. PEGGY 2.0 7.0 1.0
15. 2233548 4.0 4.0 5.0

To use the “lookup_inst" function in the model the folowing relation must be created in the assembly mode:
INSTANCE_NAME = LOOKUP_INST("333.PRT",1,"D1",X:1,"D0",Y:1)
INSTANCE_NAME is a parameter created to store the name of the instance that is going to replace the generic in the assembly;
333.PRT Is the generic part that will be checked in order to find the matching parameters
D1 and D0 are the parameters that will be checked in all instances of the generic 333.PRT in order to find a match, below you can see what the PRO|E Help tells about it

{You can automatically replace family table–driven components according to design criteria by using the lookup_inst function. With this function, you can search a component family table to find an instance that fits the values of the search parameters. If the lookup function does not find a match, it returns the name of the generic.
The format for lookup_inst is:
lookup_inst ("generic_name", match_mode, Òparam_name_1Ó, match_value_1, Òparam_name_2Ó, match_value_2,...)
where
● generic name—Name of the generic model with a prt or asm extension
●match_mode—One of the following values:
○ –1 (find closest instance with param values less than or equal to supplied values)
○ 0 (find instance with param values that match supplied values exactly)
○ 1 (find closest instance with param values greater than or equal to supplied values)
● param_name_1—Family table parameter name
● match_value_1—Value to match against}

The relation must be added in the assembly where the replacement will occur. It can be done editing the program or the relations.

After adding the relation, the program will look like this at the RELATIONS section(“TOOLS / PROGRAM / EDIT DESIGN, looks like you must have ADVANCED ASSEMBLY EXTENSION module to edit programs in assembly mode, part mode is free”):

RELATIONS
INSTANCE_NAME = LOOKUP_INST("333.PRT",1,"D1",X:1,"D0",Y:1)
END RELATIONS

Now indicate which component will be replaced replacing his name by the parameter name:
Original PROGRAM lines for addin the 333.prt file:
ADD PART 333
INTERNAL COMPONENT ID 12
END ADD

In order to replace 333.prt file with one of its instances, we are going to replace its name here by the parameter (INSTANCE_NAME) we’ve created earlier so it can be a dynamic entry.

ADD PART (INSTANCE_NAME)
INTERNAL COMPONENT ID 12
END ADD

This example was created in a scenario where once the “X” and “Y” values are changed in the relation, the lookup_inst command looks into the 333.prt file for a instance that meet the values and replace it in the parameter “INSTANCE_NAME” and the matching instance takes the place of 333.prt in the assembly, you can relate this values with parameters to make it less error prone while changing them.

RE: Pro/Program: swapping components in an assembly

We have done this many times. My recommendation is to make a backup of your assembly & generic, and work with the backup until you are happy with the results, before making the changes properly.

The way we have done this before is:-

1. Add an extra integer parameter to the model named INSTANCE_NUMBER - this is used as a unique identifier for our instances
2. Add the parameter to the family table, and iterate from 1 to whatever - make sure that each instance has a different number
3. Add a string parameter in the main assembly - I use the name of the generic as the parameter for easy reference
4. In the relations, add the if...else...endif based on load, eg

IF LOAD == 1
GENERIC_PARAMETER=LOOKUP_INST("GENERIC_MODEL.prt", 0 , "INSTANCE_NUMBER", 1)
ELSE
IF LOAD == 2
GENERIC_PARAMETER=LOOKUP_INST("GENERIC_MODEL.prt", 0 , "INSTANCE_NUMBER", 2)
....

5. In PRO/PROGRAM, find the pulley - the insert block should look like

ADD PART GENERIC_MODEL
INTERNAL COMPONENT ID 88
PARENTS = 58(#6)
END ADD

6. Replace the generic model with the parameter like

ADD PART (GENERIC_PARAMETER)
INTERNAL COMPONENT ID 88
PARENTS = 58(#6)
END ADD

7. At the top of the PRO/PROGRAM there is a line

INPUT
END INPUT

8. Add the load parameter between them like so

INPUT
LOAD_PARAMETER NUMBER
END INPUT

9. Now when you regenerate the model, you have the option to enter a new value for the load.

RE: Pro/Program: swapping components in an assembly

(OP)
@Robertib
Thanks for the tip. I will try this and get back as soon as possible.

RE: Pro/Program: swapping components in an assembly

This statement looks wrong: LOOKUP_INST("TAA266F_N.asm", "TAA266F3_N.asm")

The LOOKUP_INST is looking for parameters that match some choice. You haven't specified one. So the variable SUBASSEMBLY hasn't got a usable name.

If you already know what instance you want, use the instance name in the ADD PART() statement and use the IF ELSE ENDIF around the ADD COMPONENT () / END ADD .

RE: Pro/Program: swapping components in an assembly

(OP)
Hey Dave
Yes I know the syntax is wrong. Would like to understand the basics. I new to this.
1. I have a generic part. With 5 Instances. What would I require to do. Add an extra parameter like Instance_Number and give unique numbers????
2. How do I call this instances. What should I write in relation for this. is it
IF PASS == 8
SUBASSEMBLY=LOOKUP_INST("TAA266F_N.asm",0, "TAA266F500_N.asm",1)
ELSE
IF PASS == 6
SUBASSEMBLY=LOOKUP_INST("TAA266F_N.asm",0, "TAA266F3_N.asm",2)
ENDIF

Lets first correct my relation and then move to the program editing.

@3DDave thanks for showing up some interest. This is really impt for me in the next step. Your help is highly appreciated

RE: Pro/Program: swapping components in an assembly

You don't need to lookup any instance. LOOKUP looks for parameters not instance names. You already know exactly what part you want to substitute.

Use the IF THEN around the ADD COMPONENT directly.

Also, read the entire ProProgram help.

RE: Pro/Program: swapping components in an assembly

(OP)
@3DDAVE @RoberTip
I got this values right. Thanks for all the help.
Now I have another question. In my Relation Pass==8 this I have added in subassembly. So, If I Regenerate this subassembly it asks me for the value of Pass. I want the value of Pass to be in the main assembly. how do I link the pass value of subassembly to the main assembly.

RE: Pro/Program: swapping components in an assembly

If you read the document you would see the section on the EXECUTE command.

RE: Pro/Program: swapping components in an assembly

(OP)
@3DDAVE
Everything is working perfectly fine now. I have another query
I have used
EXECUTE ASSEMBLY xxx
Ros = Ros
END EXECUTE
This works fine for xxx assembly

I have another subassembly YYY

I tried
EXECUTE ASSEMBLY xxx , ASSEMBLY YYY
Ros = Ros
END EXECUTE

But its not taking the inputs. Correct me please

RE: Pro/Program: swapping components in an assembly

(OP)
GUYS Everyone over here. Thanks for all the help and support. I have completed my assignment successfully. smile Im looking forward for more help in the next topics. Thank you

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login



News


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close