Skip to main content
14-Alexandrite
November 9, 2017
Solved

how to play macro from relation

  • November 9, 2017
  • 19 replies
  • 7763 views

I wish to review the main relation in my complex part and also relations putted into Footer feature to review and be able to stop the pro/program workflow, so my idea is to play a mapkey with several annotation using comment functionaluty in mapkeys and be able to resume the workflow when I want.

Question: how can I run the mpkey from relation script?

Best answer by TomU

Relations can't call mapkeys.  Relations simply process the lines inside them, top to bottom.

19 replies

TomU23-Emerald IVAnswer
23-Emerald IV
November 10, 2017

Relations can't call mapkeys.  Relations simply process the lines inside them, top to bottom.

rsobecki14-AlexandriteAuthor
14-Alexandrite
November 10, 2017
Thanks Tom, this explain a lot, but maybe you have an idea how the best debug the workflow?

Changing lines in relations into comments is painful..
24-Ruby III
November 10, 2017

Hi,

 

I am sorry I do not understand your question. Please provide some examples (pictures with comments).

rsobecki14-AlexandriteAuthor
14-Alexandrite
November 10, 2017

to comment a relation we need to use "/*" for example:

/********** WALL THICKNESS CALCULATION **********
/* FIRST  CALCULATE A NEW WALL THICKNESS TO TRY AND OBTAIN THE REQUIRED \
/*CAPACITY.
/* MAKE SURE IT IS NOT TOO BIG OR TOO SMALL.
/* THEN IF A WALL THICKNESS OVERRIDE IS SET, MAKE IT EQUAL THE OVERRIDE VALUE.
/*  IF A WALL THICKNESS OVERRIDE IS SET, SKIP OVER THE CAPACITY CHECK THAT \
/*TRIES TO CHANGE THE WALL THICKNESS
/* OTHERWISE IT MAY NOT GO GREEN.

/* WALL_THICKNESS MANUALLY SET
IF (WALL_THICKNESS_OVERRIDE >1)
WALL_THICKNESS = WALL_THICKNESS_OVERRIDE
ENDIF

and if you wish to check and review some conditions and see if during regenerations and update Creo run specific way or as I call it workflow (perhaps purly driven by Pro/Program) using this combination "/*" to switch on / off some part of relation script is really painful.

Maybe ther is some smart solution to visualize where we are in the process during regeneration as for example:

1° flow through the relation in PART script first

2° then follow each part feature (as in Pro/Program)

3° do what is in Footer at the end (I have here also long relation script for annotations wisible on screen to have them up to date)

4° user press regenerate if relations still adjusting some parameters like WALL_THICKNESS for example...

 

this is because I was thinking about using a mapkey raised by relations to see where is the process currently 🙂

24-Ruby III
November 10, 2017

Hi,

 

from your explanation I understand that sometimes you need to comment several relations. Maybe you can enclose these relations into IF command and use parameter to turn it on/off, for example:

/* set MYPAR1 = 0 to turn relations OFF

/* set MYPAR1 = 1 to turn relations ON

IF (MYPAR1 == 1)

  IF (WALL_THICKNESS_OVERRIDE >1)
  WALL_THICKNESS = WALL_THICKNESS_OVERRIDE
  ENDIF

ENDIF

HamsterNL
18-Opal
November 10, 2017

Hi,

 

I have never used them myself before, but maybe the INTERACT statement could help you in this case.

 

Using INTERACT Statements as Place Holders 
INTERACT statements provide a placeholder for creating interactive part and 
assembly features. They can be inserted anywhere within the 
FEATURE ADD - END ADD or PART ADD - END ADD statement. Interact mode works similarly to Insert mode accessed from Pro/ENGINEER. Executing an INTERACT Statement When the system encounters an INTERACT statement in the program,
the execution of the program is interrupted. At this point, you
can add new features. Also at this point, the system displays an
incomplete model built up according to the last instruction before
the INTERACT statement. In Interact mode, the model is frozen
and cannot be modified. After you are in Interact mode, select any feature you want to add
from the FEAT CLASS menus and proceed to specify all required parameters.
After you have created a new feature, the system asks whether you want to
continue adding features. If you answer N, program execution resumes.
After execution is completed, any new features added within the INTERACT
statement replace the INTERACT statement in the model design. Note: You can quit interacting immediately after the program moves
into the INTERACT phase (before you start to create features).
Choose Done/Return from the FEAT CLASS menu and answer N to the
system prompt asking if you want to continue. The program resumes
execution and proceeds to the end.

Hope this helps

HamsterNL
18-Opal
November 10, 2017

It seems like my first post, which I edited for markup, was lost...so here goes again.

 

I haven't used them myself, but maybe the INTERACT statement is something to look into

 

Using INTERACT Statements as Place Holders
INTERACT statements provide a placeholder for creating interactive part and
assembly features. They can be inserted anywhere within the FEATURE ADD - END
ADD or PART ADD - END ADD statement.

 

Interact mode works similarly to Insert mode accessed from Pro/ENGINEER.

 

Executing an INTERACT Statement
When the system encounters an INTERACT statement in the program, the execution
of the program is interrupted. At this point, you can add new features. Also at this
point, the system displays an incomplete model built up according to the last
instruction before the INTERACT statement. In Interact mode, the model is frozen
and cannot be modified.


After you are in Interact mode, select any feature you want to add from the FEAT
CLASS menus and proceed to specify all required parameters. After you have
created a new feature, the system asks whether you want to continue adding
features. If you answer N, program execution resumes. After execution is completed,
any new features added within the INTERACT statement replace the INTERACT
statement in the model design.


Note: You can quit interacting immediately after the program moves into the
INTERACT phase (before you start to create features). Choose Done/Return from
the FEAT CLASS menu and answer N to the system prompt asking if you want to
continue. The program resumes execution and proceeds to the end.

HamsterNL
18-Opal
November 10, 2017

Hmmm...it seems like you don't have access to the RELATIONS when the PRO/PROGRAM hits the INTERACT statement. In fact, the options you have a very limited.

1-Visitor
November 10, 2017

if you are debugging, suppress all features below the one that's failing for starters.

also reorder your relations (if they call one another or specific dimensions) and verify the references of the failing feature first.

the first part is tedious, because you will have to delete all the IF clauses, reorder and then reinstate them.

 

also if you develop those templates, try to use at least some version control (not just .1, .2, .3.... file history). add new features in smallish chunks, verify that they are working and backup it before doing any more changes.

 

as the relations go, it's better to export them and edit them in notepad++ for any major changes, if you ask me.

it's also best to keep history of working releases.

 

what kind of an assembly do you have, if you don't mind me asking?