cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

Architectural Dimension Converter: Creo 2.0 + references

TomD.inPDX
17-Peridot

Architectural Dimension Converter: Creo 2.0 + references

A recent post had me try something different.

 

How do you make only a few select dimensions show feet/inches in an architectural format without changing the configuration files in Creo?

 

"Simple!" ...some would say, but I can tell you that this little exercise was a full day's work.

 

Suppose you need to see 9' - 4 1/2" on just one area of a drawing for say only 3 dimensions.  Sure, you can edit this value easily.

 

But say you -really- need this to be associative?  Say you -really- want to check some values quickly?  Suppose you -need- an Architectural Calculator?

 

Well, here it is!

 

The attached file is Creo 2.0 but I have also included text files for making this work in most older versions quickly.

 

First of all, the image is the "Converter" in graphic format using annotations and a sketch for a driving the primary dimension.  In order to convert a value, simply double-click on the sketch dimension annotation and edit the value.  Regenerate the model and the variables update.  The denominator limit can be set in relations.

 

architectural_converter_screen_capture.JPG

 

The first 5 lines in the attached relations file include the following two user input parameters:

 

/* set denominator limit (2, 4, 8, 16, 32, 64, or 128)
dim0denl=16

 

/* inch dimension or value to be converted
dim0=d0

 

As you can see, you can drive this from a dimension or simply enter a value for dim0.  Please notice that all the parameters are driven with the prefix dim0 so you can easily duplicate the entire list by replacing dim0 with dim1 in a text editor.

 

As noted, you also get control of the denominator.  The relations will check for a valid value and will default to 64 if the supplied value for dim0denl (Dimension Denominator Limit) is inappropriate.  The Converter will allow a denominator value of up to 128.  More than this seems moot when using fractional formats.

 

There are four text annotations on the screen in order to manage presentation.  The text for these annotations are included in the attached zip file as well.  Please note that the Converted Value is formatted in the annotation using the appropriate parameters.

 

One problem I encountered was not being able to add the " (inch) symbol within a string variable in the relations. The only solution I found was to add the inch symbol at the annotation level.  Also note the added space before the formatted string DIM0FRAC parameter.  This allows the inch symbol to be placed directly behind the integer inch value if the fraction is 0 (zero) and therefore omitted.

 

The obvious question remaining is Rounding.  Yes, the converter rounds up on 1/2 and greater of 1/denominator value and down for anything less as to conventional decimal conversion.

 

The remaining features is to drop off zero value fractions, always note feet, including 0'.  Always note while inches including 0".  A length less that 1/2 1/denominator value will return 0' - 0".

 

I hope you have a chance to play with, or better yet, use this information.  If you find this useful, please take the time to rate this document.

 

Disclaimer: I have tested this to the best of my ability and as far as I can tell, it is working properly as discussed above.  If for some reason you find anything to be amiss, PLEASE let me know so I can correct it.


This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
2 REPLIES 2

You can review the relations to see if they are compatible with your version:

/* set denominator limit (2, 4, 8, 16, 32, 64, or 128)
dim0denl=16

/* inch dimension or value to be converted
dim0=d0

/* test denominator entry (64 default on error; 128 max)
if dim0denl<>128
if dim0denl<>64
  if dim0denl<>32
   if dim0denl<>16
    if dim0denl<>8
     if dim0denl<>4
      if dim0denl<>2
        dim0denl=64
      endif
     endif
    endif
   endif
  endif
endif
endif

/* transform feet value to string variable "feet" including zero
dim0ft=(dim0/12)
dim0ift=floor(dim0ft)
if itos(dim0ift)==""
dim0feet="0"
else
dim0feet=itos(dim0ift)
endif
dim0feet=dim0feet+"'"

/* transform remaining inch value to string variable "inch" including zero
dim0in=dim0-(dim0ift*12)
dim0iin=floor(dim0in)
if itos(dim0iin)==""
dim0inch="0"
else
dim0inch=itos(dim0iin)
endif

/* round fraction up on 1/2 denominator limit, otherwise down
dim0rem=dim0-((dim0ift*12)+dim0iin)
dim0remr=dim0rem+(1/(dim0denl*2))
dim0remn=floor(dim0remr/(1/dim0denl))

/* determine minimum denominator value; test decending order
dim0fr=(1/dim0denl)*dim0remn
dim0den=128
if dim0fr*64==floor(dim0fr*64)
dim0den=64
endif
if dim0fr*32==floor(dim0fr*32)
dim0den=32
endif
if dim0fr*16==floor(dim0fr*16)
dim0den=16
endif
if dim0fr*8==floor(dim0fr*8)
dim0den=8
endif
if dim0fr*4==floor(dim0fr*4)
dim0den=4
endif
if dim0fr*2==floor(dim0fr*2)
dim0den=2
endif

/* match numerator to denominator; confirm not-zero
dim0num=dim0fr*dim0den
if dim0num==0
dim0den=0
endif

/* build fraction string or blank if zero
if dim0num==0
dim0frac=""
else
dim0frac=" "+itos(dim0num)+"/"+itos(dim0den)
endif

SYNDAKIT
14-Alexandrite
(To:TomD.inPDX)

very excited to try it out!

joe="thankful"

Top Tags