Continue to Site

Welcome to MCAD Central

Join our MCAD Central community forums, the largest resource for MCAD (Mechanical Computer-Aided Design) professionals, including files, forums, jobs, articles, calendar, and more.

Relations with Instances (family table)

zepp

New member
Could someone help me please?





I need to know the syntax of this if clause.





If instance.name == part1


d1=0


If instance.name == part2


d1=2


endif
 
The string parameter REL_MODEL_NAME holds the name of the model.

In you case the relations would be:

If REL_MODEL_NAME == "part1"
d1=0
Else
If REL_MODEL_NAME == "part2"
d1=2
Endif
Endif

Unfortunately I don't know the name of the parameter that holds the name of the generic.

Edited by: florinfaur
 
florinfaur said:
The string parameter REL_MODEL_NAME holds the name of the model.

In you case the relations would be:

If REL_MODEL_NAME == "part1"
d1=0
Else
If REL_MODEL_NAME == "part2"
d1=2
Endif
Endif

Unfortunately I don't know the name of the parameter that holds the name of the generic.





Should I erase the ELse?


Would be:

If REL_MODEL_NAME == "part1"
d1=0
If REL_MODEL_NAME == "part2"
d1=2
Endif
 
You can erase the ELSE, then it would be:


If REL_MODEL_NAME == "part1"
d1=0
Endif
If REL_MODEL_NAME == "part2"
d1=2
Endif


But what should d1 be if the model name is not part1 or part2? d1 would remain unchanged. A good program would have a default condition like:


If REL_MODEL_NAME == "part1"
d1=0
Else
If REL_MODEL_NAME == "part2"
d1=2
Else
d1=?
Endif
Endif
Endif
 
dr_gallup said:
Why would you not just put the values in the family table?





I have one file with 130 Instances and inside of the Main Generic has 8 Sub_Generics. The family table ofthe Main Generic has 23 Groups of features (columns).





I agree with you, but for large family tables andto organise the file, Idivide itin two groups:


- Relations with Dimensions;


- Family Tables with Groups of features.
 
florinfaur said:
The string parameter REL_MODEL_NAME holds the name of the model.

In you case the relations would be:

If REL_MODEL_NAME == "part1"
d1=0
Else
If REL_MODEL_NAME == "part2"
d1=2
Endif
Endif

Unfortunately I don't know the name of the parameter that holds the name of the generic.


You have to put the name of the file *.prt.
 
copyboy said:
Search in Help for "Operators and Functions for Strings" in the Fundamentals section.





Ok, but the proe has more stringsthan 2 or 3 examples...does it has?
 

Sponsor

Articles From 3DCAD World

Back
Top