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.

Logical relation

mdemers

Member
Hey,


I was told (without any additional detail) that I could achieve the following with while and if relations in Pro/E but my background in programming is very limited. Could anyone guide me through composing the relation loops?


I want relations that will take the ptc_common_name and copy/divide it into 2 parameters (let's name them titre_ligne_1 & titre_ligne_2) when there's more than 30 characters, and that will simply copy ptc_common_name to titre_ligne_1 when there's 30 characters or less. But, I'd like the cut to be intelligent i.e to divide it at the closest spaceprior to character #30.


Can anyone help?


Thanks!


Mat
 
Try this:-


pcnlength=string_length(ptc_common_name)
split=30


If pcnlength<=30
newparam1=ptc_common_name
newparam2=""
Else
If (extract(ptc_common_name,split,1))!="_"
split=split-1
endif
If (extract(ptc_common_name,split,1))!="_"
split=split-1
endif
If (extract(ptc_common_name,split,1))!="_"
split=split-1
endif
If (extract(ptc_common_name,split,1))!="_"
split=split-1
endif
If (extract(ptc_common_name,split,1))!="_"
split=split-1
endif
newparam1=extract(ptc_common_name,1,split)
newparam2=extract(ptc_common_name,split+1,pcnlength-split)
Endif



Repeat these lines as required:-
If (extract(ptc_common_name,split,1))!="_"
split=split-1
endif


For further info about relations, look here:-


[url]http://silverstone.fortunecity.com/daytona/344/proehelp/fund amentals/relations.htm[/url]
 

Sponsor

Back
Top