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

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

Drawing Template Repeat Region

bwudtke
10-Marble

Drawing Template Repeat Region

With a Drawing Template, I want to create a repeat region on drawing from the model, looking for any parameter that is named for example below :

SPEC_G_1245 and show in table as G-1245

SPEC_111345864XX and show in table as 111345864XX

 

Each parameter will have  value and description that will be output as a column.  Should look like picture attached if outputted correctly.  I am not very familiar with table relations but this would benefit us a lot as we are trying to move more to parameter based notes for drawings.

 

1 ACCEPTED SOLUTION

Accepted Solutions

If DRAWING_TABLE is a parameter defined in a regular part, then take these steps:

 

asm...

mbr...

User Defined

DRAWING_TABLE

 

It will show as "&asm.mbr.DRAWING_TABLE"

 

But if you have added Relations to a Repeat Region, and DRAWING_TABLE is defined in those relations, then take these steps:

 

rpt...

rel...

User Defined

DRAWING_TABLE

 

It will show as "&rpt.rel.DRAWING_TABLE"

 

 

For your info, here are the Repeat Region Relations I made in a test part. The test part has a paramet name "DRAWING_TABLE" with a value of "SPEC_G_1245". The Repeat Region Relations create a new parameter called ZZ which I have added to the BOM. Notice the way that you'll need to reference the DRAWING_TABLE parameter (you'll have to replace all dots "." with underscores "_")

 

XXX = asm_mbr_drawing_table

Y = "SPEC_"

XX =extract(XXX,string_length(y)+1,string_length(xxx)-string_length(y))

Z = search(XX,"_")

if Z == 0
/* The string does not contain an underscore
ZZ = XX
else
/* The string has an underscore
ZZ = extract(XX,1,Z-1)+"-"+extract(XX,Z+1,string_length(XX)-Z)
endif

View solution in original post

19 REPLIES 19
BenLoosli
23-Emerald II
(To:bwudtke)

Two thoughts come to mind.

The easiest method would be to create a parameter called draw_spec (or something) and use that for your column in the repeat region. Then you can format the spec name exactly how you want it in your BOM.

Second method would be a repeat region relation where you look for the string beginning with 'SPEC' and then capture the rest of the string for your BOM display. Might need to also parse the string for the underscore character and replace it with a dash.

We are looking to do the second method you stated.  But  I am not sure the correct way to even call out the relation,  do you think you could help out with that?

BenLoosli
23-Emerald II
(To:bwudtke)

The stripping of the spec part I could probably work out easily. replacing the underscore with a dash may be a little more than repeat region relations can handle. The relation code can do it, put it gets messy, especially if the position of the underscore character is not consistent.

 

Option 1 is by far the easiest. What objections does your company have with adding a simple parameter to your files?

 

Text manipulation is indeed messy...

 

Just take a look at the code below. It will assume that your text has a maximum of one underscore in your description.

 

XXX = "SPEC_G_1245" /* "SPEC_111345864XX "

Y = "SPEC_"

XX =extract(XXX,string_length(y)+1,string_length(xxx)-string_length(y))

Z = search(XX,"_")

if Z == 0
/* The string does not contain an underscore
ZZ = XX
else
/* The string has an underscore
ZZ = extract(XX,1,Z-1)+"-"+extract(XX,Z+1,string_length(XX)-Z)
endif

The idea is that the parameters are in the model that call out the designated specification that the part needs.  With this table Im just trying to output all the specs.  The problem is that we have multiple different spec numbers, so i thought adding "SPEC_" would help search for that with a relation.  If you look at the picture in the post above it shows what the output should be.

 

Here is a walkthrough of what I would like the relations to do..

1. search for any parameter in model with contains "SPEC_"

        Create new parameter removing "SPEC_" 

             Then, after "SPEC_" is removed, search for "_",

                       Then, Create new parameter to replace "_" with "-"

I think we all need to be on the same page.

 

In your description of your problem (challenge), it sounds like the parts themselves have different parameters (the name of the parameter itself is different). The parts should have the same parameter, but the value can be different for all those parts.

 

When you are creating a Repeat Region, you are adding a parameter to your table. The Repeat Region will show the value of that parameter. So a Repeat Region can show the values of the parameter "draw_spec" of all the parts in your assembly.

 

As soon as you can show that "draw_spec" paramter in a Repeat Region, you can add the text manipulation in my previous post to strip "SPEC_" from the value of the parameter and replace one underscore with a minus-sign.

 

You could also add a Filter to your Repeat Region and only show parts or assembies which have the "draw_spec" parameter. So if only 4 parts have a "draw_spec" parameter, only those 4 parts will be shown in your Repeat Region.

 

HTH!

I have created a BOM, but i am having a hard time reporting the parameter "DRAWING_TABLE" to repeat region.   How would this be reported?  &rpt.rel.drawing_table   ?    That is not working for me.

If DRAWING_TABLE is a parameter defined in a regular part, then take these steps:

 

asm...

mbr...

User Defined

DRAWING_TABLE

 

It will show as "&asm.mbr.DRAWING_TABLE"

 

But if you have added Relations to a Repeat Region, and DRAWING_TABLE is defined in those relations, then take these steps:

 

rpt...

rel...

User Defined

DRAWING_TABLE

 

It will show as "&rpt.rel.DRAWING_TABLE"

 

 

For your info, here are the Repeat Region Relations I made in a test part. The test part has a paramet name "DRAWING_TABLE" with a value of "SPEC_G_1245". The Repeat Region Relations create a new parameter called ZZ which I have added to the BOM. Notice the way that you'll need to reference the DRAWING_TABLE parameter (you'll have to replace all dots "." with underscores "_")

 

XXX = asm_mbr_drawing_table

Y = "SPEC_"

XX =extract(XXX,string_length(y)+1,string_length(xxx)-string_length(y))

Z = search(XX,"_")

if Z == 0
/* The string does not contain an underscore
ZZ = XX
else
/* The string has an underscore
ZZ = extract(XX,1,Z-1)+"-"+extract(XX,Z+1,string_length(XX)-Z)
endif

You could also use the exists function to check if a part has the "DRAWING_TABLE" parameter:

 

if exists("asm_mbr_drawing_table")
XXX = asm_mbr_drawing_table

Y = "SPEC_"

XX =extract(XXX,string_length(y)+1,string_length(xxx)-string_length(y))

Z = search(XX,"_")

if Z == 0
/* The string does not contain an underscore
ZZ = XX
else
/* The string has an underscore
ZZ = extract(XX,1,Z-1)+"-"+extract(XX,Z+1,string_length(XX)-Z)
endif
else
ZZ = "Oops"
endif

@bwudtke, did you succeed in showing "DRAWING_TABLE" in your repeat region?

@HamsterNL   Thank you so much for the time on this.  This helps alot, I have gotten the table to work, but still am having problems with the filter to remove anything that does NOT have the "DRAWING_TABLE" parameter.   I have tried adding a filter, &asm.mbr.param == DRAWING_TABLE, but it removes everything from the table.  Thoughts?

Try

 

&asm.mbr.param.name == DRAWING_TABLE

That did not seem to work. 😕  I have attached my drawing file if this helps at all.  

@bwudtke,

 

I have taken a quick look at your example.

 

To make it work, I had to edit the Repeat Region Relations, and remove the top half where a "LOST SYMBOL" was being used.

 

So the Relations are now:

 

/************************************************************
if exists ("asm_mbr_ptc_material_PTC_MATERIAL_NAME") /*if item is a material
if search (asm_mbr_ptc_material_ptc_material_name,"SI") == 1 /* global material?
KPS = asm_mbr_ptc_material_kpsmat
SDMO = asm_mbr_ptc_material_ptc_material_description
thick = asm_mbr_ptc_material_thickness
mm = 'mm '
endif
endif

/*************************************************************************

/* START - part name

IF search (asm_mbr_name,"_") == 0 /*Search for an underscore in the part name
partnum = asm_mbr_name
ELSE
partnum = extract(asm_mbr_name,1, search (asm_mbr_name,"_") - 1) /* If name has an underscore, then truncate the Part No.
endif

/* END - part name

 

Then I modified the Filter to:

 

&asm.mbr.param.name == DRAWING_TABLE

 

The table then showed only two entries B (the two bulk items)

@HamsterNL   This is what did it!!  Thank you so much!

Can you show an actual generic part number and describe what you are doing?

All I am trying to do is filter a "simple" repeat region to only show parts that have the parameter "DRAWING_TABLE."  The file above has a sheet metal part BOM with two bulk items that contain the parameter "DRAWING_TABLE" and the sheetmetal file part in the BOM does not include the parameter.  I just have to get the correct table filter to only show parts that have "DRAWING_TABLE" included and am having a hard time.

 

Filter:

&asm.mbr.param == DRAWING_TABLE 

or

&asm.mbr.param.name == DRAWING_TABLE 

doesn't work

BenLoosli
23-Emerald II
(To:bwudtke)

From your screenshot of the BOM, are these items added as bulk items into your assembly?

If they are, what is the parameter name you are using for the BOM table?

Like Hamster shows, the code gets convoluted if there is any deviation. Will it always be SPEC_X_######?

Stripping the SPEC_ is easy, as shown. Parsing the rest, unless a fixed format, is difficult.

 

I will repeat myself and say the easiest solution is to add a parameter for draw_spec to your files and use that in the BOM. If the spec is the partname, then put the relations in your file to generate the parameter for every part.

I do find the option of adding a bulk item to the assembly a good idea, but the original thought was that we only would have to add a parameter that would always be "SPEC_#####"

Top Tags