Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

suppressing and resuming groups using pro program 1

Status
Not open for further replies.

dustin138

Mining
Jan 31, 2007
29
0
0
US
can anyone help with my problem please!

Facts:
-Both groups are suppressed to start with:
-Both groups can not be resumed at the same time.

Goal:
When conditional statement 1 (IF HEAP_PROJ_DISTANCE_1:FID_HEAP_AXIS_DISTANCE_1 > ACTIVATION_DISTANCE) is true, I need for group 1 to be resumed and group 2 to be suppressed.

If conditional statement 1 is not met I need both to stay suppressed and then a second conditional statement (IF HEAP_PROJ_DISTANCE_1:FID_HEAP_AXIS_DISTANCE_1< ACTIVATION_DISTANCE) to be performed and If conditional statement 2 is true, I need for group 2 to be resumed and group 1 to be suppressed.


Problem:

I can’t get the order and syntax of the pro program file correct so that it is executed properly

Also I know that even if I can get this to work I will still have another issue.

Issue:

If group 1 is suppressed and group 2 is resumed and I make a change to a dim which changes the situation from group 1 suppressed and group 2 resumed to group 2 suppressed and group 1 resumed it will cause a problem because group 2 is resumed and when group 1 is resumed I have a failure due to the geometry and features both groups can not be resumed at the same time.

below is the program file with the first conditional statment in it the group1 id is 1386 and the second is 1506. Can anyone help with this problem/ by the way i'm a first time user of this site and pro program.

 
Replies continue below

Recommended for you

Hora,
Thanks for the info, but after reading these two threads i'm not sure that i fully understand what I need to do still. Is it possible for you to help in more detail? if so i can post what i have so far and maybe you can tell me where i'm going wrong. Thanks in advance for your help.
 
OK, I will try to help you.

Add the following relations:

if HEAP_PROJ_DISTANCE_1:FID_HEAP_AXIS_DISTANCE_1 > ACTIVATION_DISTANCE
dummy = 1
else
dummy = 0
endif

Now, in Pro/Program identify the group of the features you want to activate or supress and add this statement:

IF DUMMY == 1
..
..
..
..
ENDIF

That's all.

Practice with this simple example: Create a cylinder and add a hole onto it. Then add the parameter dummy equals with 1 (dummy = 1).

Edit the Pro/Program and identify the hole. You should see something like this:


ADD FEATURE
INTERNAL FEATURE ID 60
PARENTS = 1(#1) 5(#3) 39(#5)

CUT: Extrude

NO. ELEMENT NAME INFO STATUS
--- ------------ ----------- ------
1 Attributes One Side Defined
2 Section Sk. plane - Surface of feat #5 (PROTRUSION) Defined
3 MaterialSide Inside section Defined
4 Direction Defined
5 Depth Through Next Defined

SECTION NAME = S2D0002

FEATURE IS IN LAYER(S) :
02___PRT_ALL_AXES - OPERATION = SHOWN
AXES - OPERATION = SHOWN

FEATURE'S DIMENSIONS:
d4 = 36.982 Dia
d5 = 75.227
END ADD


MASSPROP
END MASSPROP

Now add the IF and ENDIF statements. You will have this:

IF DUMMY == 1

ADD FEATURE
INTERNAL FEATURE ID 60
PARENTS = 1(#1) 5(#3) 39(#5)

CUT: Extrude

NO. ELEMENT NAME INFO STATUS
--- ------------ ----------- ------
1 Attributes One Side Defined
2 Section Sk. plane - Surface of feat #5 (PROTRUSION) Defined
3 MaterialSide Inside section Defined
4 Direction Defined
5 Depth Through Next Defined

SECTION NAME = S2D0002

FEATURE IS IN LAYER(S) :
02___PRT_ALL_AXES - OPERATION = SHOWN
AXES - OPERATION = SHOWN

FEATURE'S DIMENSIONS:
d4 = 36.982 Dia
d5 = 75.227
END ADD
END IF

MASSPROP
END MASSPROP

Exit Pro/Program and incorporate changes into the part. Now change the dummy variable to 0. Your feature will dissapear after regeneration.

Let me know if it works.

-Hora




 
Hora,
i tried this but it does not do exactly what i need it to. let me give you the senerio using your suggestion that i think has to happen and maybe you can tell me if it is possible. what i need to happen (this is a .prt file):

If dummy = 1, then group1 and 2 need to be suppressed, then group 1 needs to be resumed.

(again it needs to cut both off first because both can not exist at the same time if a previous condition existed where group 1 was suppressed and group 2 was resumed)

if dummy = 0 then suppress group 1 and resume group2
 
Why not give 3 values to dummy? 0 for both supressed, 1 for both resumed and 2 for only one supressed?

Can you do it?

-Hora
 
again i'm new at pro program so i'm not sure how the third variable would be incorporated in the relation file can you help? also how do you tell pro program to suppress all the members of the group 1 and 2 and then tell it how to resume all the members of group 1 later in the file. example below just using 1 feature:

IF DUMMY ==1
ADD SUPPRESSED FEATURE
INTERNAL FEATURE ID 833
PARENTS = 570(*) 730(*)

then would you copy the above text and do this?

IF DUMMY ==1
ADD SUPPRESSED FEATURE
INTERNAL FEATURE ID 833
PARENTS = 570(*) 730(*)

because when i try this is gives me an error saying

!*** ERR: no END ADD statement for ADD on line 0
!*** ERR: file contains more IF's than ENDIF's

AND I HAVE AN END IF AT THE END OF THE FILE JUST BEFORE THE MASS PROP
END MASSPROP
 
First rule: Each IF must have an ENDIF.

So you must have this:

IF DUMMY ==1
ADD SUPPRESSED FEATURE
INTERNAL FEATURE ID 833
PARENTS = 570(*) 730(*)
ENDIF

About MASSPROP:

This is the last thing you will see in your Pro/Program file. The END before MASSPROP must lay there. In fact you can instruct Pro calculating the mass of the part each time you regen the part by doing this in the MASSPROP section:

MASSPROP
part xxxx.prt (your part name here)
END MASSPROP

Now, back to our business:

You can copy and paste features inside Pro/Program. Each feature must have an unique ID.

I will verify if you can suppress a single member of a group but I'm pretty sure you can't. So I think you must ungroup the features (if possible).

-Hora

 
Ok, here we go:

Only one feature of a group of features cannot be supressed without supressing the whole group.

The good news for you is that you don't need this: I looked at your first statement and you have asked to supress two groups, or only one. Not individual features of any group.

So you need this variable "dummy" having 3 values: 0, 1 and 2

0 - will supress both groups
1 - will resume both groups
2 - only one group will be supressed (last one in my example)
if you nedd to supress the second grou, another value (3) will be needed for your "dummy" variable.

In ProProgram you must have something like this:

IF (DUMMY == 1 || DUMMY == 2)
...
... (SET OF FEATURES BELONGING TO GROUP 1 HERE)
...
ENDIF

IF (DUMMY == 1)
...
... (SET OF FEATURES BELONGING TO GROUP 2 HERE)
...
ENDIF

As you can see, if "dummy" will be 2, only the first group will be shown and the second one will be supressed. If "dummy" will be 0, then both will be supressed.

The "||" means "or" and it came from C language.

IMPORTANT: When you will edit the ProProgram assure all groups are NOT SUPRESSED. It's easy.

Give it a try!

-Hora
 
ok i think we are getting closer but, i need to clarify a few things. i have created a conditional flow chart to help put things in better perspective. but it will not format correctly in the reply to this thread comment box...
 
Hora, thanks for the response I appreciate all your help so far. I definitely want to do it on my own so I learn the most that I can I just wanted to send you everything I had so you could get a clear picture of where I am trying to go with this thing.
 
Hora, i performed the exercise you sent and tried all types of variations and it works fine but if you have an example like mine it does not work like this. I created a very simple version of what i have, using your prt0001.prt model that you sent. I will send it to the same place i sent the info from yesterday but aside from this we will keep contact through this site. the example i'm sending has the conditional statments removed from the pro program file. You will notice that you can resume group 1 or group 2 on there own but not together. if you don't mind see if you can get this example to work and if so i think we can solve the other problem. thanks. lets say for the example:
if dummy == 1 supress both groups then resume group 1
if dummy == 2 supress group1 and resume group 2
if dummy == 0 supress both groups.

Thanks
 
i will try our latest suggestion but meanwhile i sent the backwards compatible file and a word doc on how to do this (real easy) to the same place i sent the other files. i'll let you know how the latest thing works out, let me know if you have any sucess at working with the latest file i sent you.

thanks again
 
Hora,
i tried your new example and it works with your example but i think because my situation is still different enough that it doesn't work in my case. Please let me know if you where able to open the last file i sent? if not i can probably explain how to modify your example to make it like the latest file i sent.
 
If the file was created in Wildfire, I cannot open it. I don't have Wildfire. We are still on 2001.

Probably your features of the groups are not groupped together or there are links between features.

Try first to suppress only one group.

-Hora
 
Status
Not open for further replies.
Back
Top