Skip to main content
12-Amethyst
April 20, 2021
Question

Repeat regions and dimensions

  • April 20, 2021
  • 11 replies
  • 4503 views

Hello, 

I'm running into some issues trying to pull part dims into a repeat region. I'm working towards having as much info automatically pulled into the to remove any user error from manually typing information and dimensions. 

 

When I click into the repeat region and select asm->mbr->D1, it correctly pulls that info. The same is true for D2.

I wrote the following relation (with some help from other posts regarding real numbers to string conversion) to put these dims into a string so it shows "Length X Width":

 

 

IF ASM_MBR_D1 > ASM_MBR_D2
	LENGTH = ASM_MBR_D1
	WIDTH = ASM_MBR_D2
IF ASM_MBR_D1 < ASM_MBR_D2
	LENGTH = ASM_MBR_D2
	WIDTH = ASM_MBR_D1
ENDIF
ENDIF

/* CONVERT LENGTH REAL NUMBER TO STRING WITH 2 DECIMALS
LENGTH_STR = ITOS(FLOOR(LENGTH+.0005))+"."+\
	EXTRACT(ITOS(((FLOOR((LENGTH+.0005),2))\
	-FLOOR(FLOOR((LENGTH+.0005),2))+1)*1000),2,2)
WIDTH_STR =ITOS(FLOOR(WIDTH+.0005))+"."+\
	EXTRACT(ITOS(((FLOOR((WIDTH+.0005),2))\
	-FLOOR(FLOOR((WIDTH+.0005),2))+1)*1000),2,2)

/* LIST DIMENSIONS IN ONE STRING
part_dimensions = LENGTH_STR+" X "+WIDTH_STR

 

 

The result is ".00 X .00".  For some reason, I can't get it to grab those D1, D2 dims when I use them in a relation.  Do I need to use the specific part dims sd0, sd1?  If that's the case, can someone help me with syntax, I'm not sure how to call those in a relation. 

 

Any thoughts?  Any and all help is greatly appreciated! I'm pullin my hair out trying to get this to work...

11 replies

23-Emerald III
April 20, 2021

I would think it would be easier to pull the dimensions and format your description at the part level than mess with repeat region relations.

When you put the object into your assembly and then the drawing, the description will pull into the BOM with no editing of the repeat region.

 

lockarde12-AmethystAuthor
12-Amethyst
April 20, 2021

@BenLoosli Thanks for your response!  Can you elaborate a little on this?  I'm very new to Creo (3 mos in) and I don't have a solid handle on how everything is interconnected.  I have columns in my model tree at the part level labeled D1, D2; for now I have manually entered values into these columns, but I believe I can use relations to automate that as well.  I think that's where it was pulling that data from when I add the value to rpt region.  Is this what you're referring to? 

 

Am I over thinking this? Can get this data a much simpler way?

 

So you get an idea of the context - almost all of my parts are extruded rectangles, and I'm trying to get the LxW of these into the table to act as a cut list.  I'm trying to automate this A) because typing the dims manually is time consuming, and B) to avoid any error by mistyping

23-Emerald III
April 20, 2021

Overthinking can be as bad as underthinking at times.

You have a bunch of rectangular plates, are you using a family table to create the parts or individual part files?

Either way, you can do a bunch of things with relations and parameters.

When you model the plate, you end up with 3 variable dimensions, length, width and thickness, identified as d1, d2, and d3. These can then be renamed to length, width and thickness for easier manipulation.

Take one of the dimension names and now you have to convert the real number into a string value for use in your note. There is no real to string function in Creo, only integer to string (itos).

 

Multiple methods to do the conversion, but here is one I use.

/** Set the THK Value for the description
THK1F=(floor(THK))
if THK1F==0
THK1S=''
else
THK1S=itos(THK1F)
endif
THK2=((THK-THK1F)*10)
THK2F=floor(THK2)
if THK2F==0
THK2S='0'
else
THK2S=itos(THK2F)
endif
THK3=((THK2-THK2F)*10)
THK3F=floor(THK3)
if THK3F==0
THK3S='0'
else
THK3S=itos(THK3F)
endif
THK4=((THK3-THK3F)*10)
THK4F=floor(THK4)
if THK4F==0
THK4S='0'
else
THK4S=itos(THK4F)
endif
full_thk=thk1s+'.'+thk2s+thk3s+thk4s

full_thk is a 3 decimal place string. You can play with the digits. 

If I have THK = 23.457, then full_thk would be 23.457, but a string so I could do this:

Description3 = 'PART THICKNESS = '+full_thk.

 

Doing this in the part file allows you to create a BOM table that uses Description1, Description2 and Description3 as parameters in a single cell or 3 columns, depending on your format requirements.

 

The PTC Creo Help has a whole chapter on relations that is very useful. They are different from the repeat region relations, but somewhat similar. 

 

I would always drive dimensioning format information from the individual pieces and not try to calculate and form them at the assembly drawing level.