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

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

Linestock User Defined Parameters

Barra_CSGAS
4-Participant

Linestock User Defined Parameters

I’m having an issue with trying to get a User defined parameter PIPE_DESCRIPTION from the linestock to the piping start part parameter DESCRIPTION.

This is so when creating a pipe solid, each pipe part will have the PIPE_DESCRIPTION parameter value added to the DESCRIPTION parameter.

Then I can bring this into my table BOM, along with all the other fittings and parts which have the same parameter.

Is this possible or is there another way?

I'm using Creo Parametric 10.0.4.0

1 ACCEPTED SOLUTION

Accepted Solutions

All, I thought I should post a solution (work around) I've found.

I found that I can create the same parameter name in the start part as the locked parameter from the linestock, i.e. (OD) and when using the pipe solid command, it would populate the data from the linestock to the pipe part created in the assembly.

therefore, I could create a relation using the OD to populate the DN parameter using IF statements.

because all parameters are in the start part there is no errors.

IF OD == 114.3
PIPE_DN_SIZE="DN100"
ENDIF

and Wall thickness to populate the schedule size using IF, &(AND) (only used when a duplicate WT between sizes and schedules) as well as |(OR) Statements.

/* DN50 TO DN80
IF WALL_THICKNESS == 5.54 | WALL_THICKNESS == 7.62 | WALL_THICKNESS == 8.56
PIPE_SCH="XS"
ENDIF

and having 2 different start parts, one for welded pipe, the other for seamless, and having a fixed parameter (pipe_std) for those,

I was then able to combine them together to form the required description 

DESCRIPTION=STOCKNO + ", " + PIPE_DN_SIZE + ", " + PIPE_TYPE + ", " + PIPE_SCH +", " + PIPE_STD

Stockno & Pipe_type are also populated from the linestock when the pipe solid command is run.

Note:

The regenerate command needs to be run after the pipe solid command for the data to be populated.

Hope this helps

View solution in original post

7 REPLIES 7

If the DESCRIPTION parameter is the one you want to use in the bill of materials, then you should address building that parameter using other information. If I were doing this I'd probably have another parameter called something like USER_DESCRIPTION which contains what you currently use for DESCRIPTION. Then add a relation of the sort

DESCRIPTION = PIPE_DESCRIPTION + ", " + USER_DESCRIPTION

I don't know how you access the PIPE_DESCRIPTION, however. Is it an accessible parameter from within your part?

Barra_CSGAS
4-Participant
(To:KenFarley)

thanks, Ken, for your reply,

I've tried what you have suggested the issue here is the parameters needs to be within the same component, otherwise you get an error, unless there is something I'm missing in the relations function, as I'm only new to Creo.

Below image is where I'm trying to get the PIPE_DESCRIPTION parameter, as this is a common location for all of the different pipe types and sizes.

for example, if the pipe reducers, then another linestock is associated to that pipe segment, and other pipe solid part is created from a start part.

If that start part could read the linestock parameter and populate the DESCRIPTION my problem would be solved.

Barra_CSGAS_0-1719349579719.png

I would be happy to set up a Mapkey to grab the Linestock parameter then populate the description after the pipe solid has been created, however I don't know how to extract it from the User defined tab.

I've also tried breaking up the description as you have suggested, the issue here is that each would have to be populated manually every time something I'm trying to avoid again.

RPN
17-Peridot
17-Peridot
(To:Barra_CSGAS)

 

If you use Tookit, that’s all you need.

 

typedef enum 
{
  PROLNSTKPRM_SINGLE,
  PROLNSTKPRM_MULTIPLE
  
} ProLnstkParamType;

typedef struct pro_lnstk
{
  ProName            name;
  ProAssembly        owner;
  
} ProLnstk;


typedef struct _pro_lnstk_param_memb_
{
  ProName            name;
  ProParamvalue      value;
  
} ProLnstkParamMemb;


typedef struct _pro_lnstk_param_
{
  ProName            name;
  ProLnstkParamType  param_type;
  union {
           ProParamvalue         value;
           ProLnstkParamMemb    *members;
        } lnstk_param_value;
} ProLnstkParam;


					   ProLnstkParam **p_params);

/*
  Purpose: Retrieves parameters of specified linestock

   Input Arguments:
    lnstk                  - Handle of linestock.

   Output Arguments:
    p_params               - ProArray of parameters.
                             The function allocates memory for these arguments.
                             To free it, call the function ProArrayFree.

   Return Values:
      PRO_TK_NO_ERROR      - The function successfully retrieved parameters.
      PRO_TK_BAD_INPUTS    - One or more of the arguments are invalid.
      PRO_TK_E_NOT_FOUND   - Lnestock with this name does not exist.
      PRO_TK_GENERAL_ERROR - Other error.
*/

extern ProError ProLnstkParametersSet( ProLnstk      *lnstk,
				       ProLnstkParam *p_params);

/*
  Purpose: Set parameters for specified linestock

   Input Arguments:
    lnstk                  - Handle of linestock.
    p_params               - ProArray of new parameters.

   Output Arguments:
    None

   Return Values:
      PRO_TK_NO_ERROR      - The function successfully sets new parameters.
      PRO_TK_BAD_INPUTS    - One or more of the arguments are invalid.
      PRO_TK_E_NOT_FOUND   - Linestock with this name does not exist.
      PRO_TK_GENERAL_ERROR - Other error.
*/

 

From Help via Relation:

 

The following file is an example of how to write a relation to control the width of a channel in a pipeline. The following relations control the width of the channel, d7:0, to keep it equal to the outer diameter of the pipe, as specified in the pipeline feature’s line stock parameters (assuming that the only two fluids in use are oil and H2O and that each gets assigned a single line stock):
 

IF fluid:fid_LINE1 = ‘oil’
d7:0 = OD:fid_OIL_STK
ELSE
d7:0 = OD:fid_H2O_STK
ENDIF

 

Barra_CSGAS
4-Participant
(To:RPN)

Thanks, RPN,

Yes, I can see this as a solution however I would need to learn C-language for this, and I have the PTC User Guide,

however, I don't have the time at the moment.

RPN
17-Peridot
17-Peridot
(To:Barra_CSGAS)

But you checked the relation as well, you have to use fid to access the parameter and the value.

Barra_CSGAS
4-Participant
(To:RPN)

Hi RPN,

Yes, I tried the relation using the feature ID and found that it could bring the required parameter from the linestock into the assembly,

however, i needed it into the Pipe Part that's created from the pipe solid command, so this doesn't do what I needed, also the feature ID changes from model to model depending on when it's added to the model so the relation will have to be change each time to suit this.

 

All, I thought I should post a solution (work around) I've found.

I found that I can create the same parameter name in the start part as the locked parameter from the linestock, i.e. (OD) and when using the pipe solid command, it would populate the data from the linestock to the pipe part created in the assembly.

therefore, I could create a relation using the OD to populate the DN parameter using IF statements.

because all parameters are in the start part there is no errors.

IF OD == 114.3
PIPE_DN_SIZE="DN100"
ENDIF

and Wall thickness to populate the schedule size using IF, &(AND) (only used when a duplicate WT between sizes and schedules) as well as |(OR) Statements.

/* DN50 TO DN80
IF WALL_THICKNESS == 5.54 | WALL_THICKNESS == 7.62 | WALL_THICKNESS == 8.56
PIPE_SCH="XS"
ENDIF

and having 2 different start parts, one for welded pipe, the other for seamless, and having a fixed parameter (pipe_std) for those,

I was then able to combine them together to form the required description 

DESCRIPTION=STOCKNO + ", " + PIPE_DN_SIZE + ", " + PIPE_TYPE + ", " + PIPE_SCH +", " + PIPE_STD

Stockno & Pipe_type are also populated from the linestock when the pipe solid command is run.

Note:

The regenerate command needs to be run after the pipe solid command for the data to be populated.

Hope this helps

Top Tags