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.

Using Patterns to Create a Clock Face

mediumsliced

New member
Hello everybody,

Here's a challenge that's been trying my poor little brain. I'm trying to use relations, parameters and an axial pattern to create numbers on a watch dial or clock face. For example, it may be "12 1 2 3 4 5 6 7 8 9 10 11" or it may be "XII I II III IIII V VI VII VIII IX X XI".

Read an example of a relation using the EXTRACT function on the PTC/USER exploder, but for the life of me, I can't find documentation on that particular function, so I don't know how it works.

The example I got from the exploder goes a little something like this:







LETTERS="ABCDEFGHIJKLMNOPQRSTUVWXYZ"

NUM_CHARS=string_length(LETTERS)

if sd0/6<=NUM_CHARS

ALPHA=extract("ABCDEFGHIJKLMNOPQRSTUVWXYZ",sd0/6,1)

else

L1=floor(((sd0/6)-1)/NUM_CHARS)

L2=sd0/6-L1*NUM_CHARS

ALPHA=extract(LETTERS,L1,1)+extract(LETTERS,L2,1)

endif


Can anybody help? I can't make heads or tails of the relation above, especially the extract, L1, L2 and ALPHA bits.


Edited by: mediumsliced
 
Thanks doronron1, that was a pretty good read.

I am now thinking that there should be an easier way to do this. The problem is simple. I want to have a parameter increment in a simple series, e.g. 1, 2, 3... until it ends at 12. What I know is this, every increment in value is tied in to the angle from the 12 o'clock position, i.e. 1 is at 30°, 2 is at 60°, et al.

Using the IF-ELSE statements won't help me here now, would it?
 
It is possible to do this, I have done it in the past. I am not currently working at that company so I do not have access to the old files. Also I am not currently working with Pro/E so I can not create and example. I do know that you can set the text used in a sketch to that of a parameter. Try assigning a parameter to the feature to represent the hour. Then set the value of the hour text depending on the angle. I.E. hour = angle/30. Next pattern the feature.


Good luck
 
smiley32.gif
Well done!


As they say you live and learn!
 
OK, so I want to do pretty much the same thing byt I want the numbers to rotate rather than stay vertical. Also I'm using WF2 but I have WF4 so I was able to open & take a look at that nice example gafatwork uploaded. I started with a datum feature through an axis at an angle to the vertical axis & changed the section relations to:

TIME = SD#/30 + 1
TIMETEXT = ITOS(TIME)

The lead feature is at angle 0 and it works OK but then the second feature repeats the 1 & then the pattern starts to work.
 
I saw this thread and thought I would post another method to increment the required text. This model has a linear pattern and rotational pattern to illustrate both possibilities. The relation is created in the sketch using the ITOS function as GAF had posted previously but the formula does not depend on the angle. In simple terms, the relation counts the pattern position by the current dimension divided by the increment amount. The linear example has a betterdescription commented in the relation editor. I found it easier if I create the parameter, then sketch with the relation entered within a commented line since the variables needed won't exist at that time. Then exit the sketcher, pattern the feature then select the second pattern instance and then pick edit to find the dimension labels required.


For the clock face edit the pattern and lead feature to incorporate the correct angles and pattern count.


Created in WF2:


2009-04-07_133859_letter_pattern_samples.prt.zip
 
Pro E crashes out if I tried to edit the sketches in the above attached model. Can you kindly post the relations used in the model?


Regards,


Anand
 
Anand:


That is very interesting, I opened the file this morning when I saw your message and I had the same result. I tried many times but each one would fail. It does appear to have something to do with the relation athough no errors show. You should be able to view the relation from the model view instead of within the sketcher. Select Tools>Relations> then Section in the drop down box > pick the first instance in the first pattern as it is the one with the desciption. You may comment out the relation or delete sd0, regen,and then it will allow you to edit the sketch.


The only thing that I can think of is the relation uses a variable from the sketch (sd0) and then d5 and d7 from the pattern which are defined later.If you deletesd0 from the relationProE won't crash but the pattern resultswill not be correct.Text1 is a string parameter like GAF used.


Anyone have any other ideas or work arounds on this one? Would it work in another version of ProE?


Bob
 
Hi Bob,


Thanks for the clarifications. I shall try to follow your method tomorrow. Its very late now here in Japan (12.20 AM) and also I do not have access to Pro E right now.


Regards,


Anand
 
Hi Bob,


I followed your instruction of deleting sd0 dimension from the relation. But still I got the error message that dim d7 was not found.
 

Sponsor

Articles From 3DCAD World

Back
Top