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.

Register Log in

Part name > parameter with decimal places?

proed

Moderator
A question from one of my colleagues that I couldn't solve...



...our legacy part numbers, which are being used for the drawing number, use periods for the separators, eg.



L09.275.00



As you probably know, ProE does not allow for periods in naming objects. As a result the drawing numbers are shown on the drawings with dashes as the separators.



Is there any way to write a program to read the name of the drawing and automatically replace dashes with periods and place that value in the new parameter?



Maybe the parameter could read the drawing name and by default use that, but if the button is pushed the dashes would be replaced with periods.



Grateful for any help you can give.

Ed
 

TonyJager

New member
You would not need to push a button to convert it could be done as a relation. You could replace the string with something whatever you want.

This way the parameter would always stay 'parametric'

If you need some help let me know

Tony
 

proed

Moderator
Thanks to Johannes from Denmark - he gave me a headstart with some interesting relations...



After a fair bit of tweaking, this is the kind of thing we came up with:



/*-------------------------------------------

a1=rel_model_name()



w1=search(a1,-)

pa1=extract(a1,1,w1-1)

a2=extract(a1,w1+1,string_length(a1)-string_length(pa1)-1)



w2=search(a2,-)

pa2=extract(a2,1,w2-1)

a3=extract(a2,w2+1,string_length(a2)-string_length(pa2)-1)



part_name=pa1+(.)+pa2+(.)+a3

/*-------------------------------------------



A couple of notes:

- rel_model_name() gives you the Pro/E model name

- extract(input,start,length) returns a substring of the input

- a1, w1, pa1 etc were temporary variables to help build up the final part name string



Ed
 

Sponsor

Top