Continue to Site

Welcome to MCAD Central

Join our MCAD Central community forums, the largest resource for MCAD (Mechanical Computer-Aided Design) professionals, including files, forums, jobs, articles, calendar, and more.

turning parts 'off' in pro/program

skiddy

New member
in a prt. file i have created geometry consisting of 10 seperate components. I have placed them in a local group.



But i am now unsure if i can turn this group off using pro/program?



example of statements....... ball= group name



input

include_ball yes_no

ball? yes no

end input



/*START OF GROUP

if include_ball==yes

Add part ball

........................



/*END OF GROUP

end add

endif



should this work????
 
This should work in theory.

Make sure your IF & ENDIF statements are outside all references to the group & its parts.



(Not sure about adding /* comments into the body of the program...)

Send me the complete program if you want more help.
 
Sorry im still stuck!!!

Tried going back to basics, created three simple solid protrusions and formed them into a local group. Entered the statements into pro program.



but it wont work, just produces two errors.



Ive copied the whole pro program, (showing where the two errors occur) see below...... can you see where im going wrong??



Many thanks



VERSION

REVNUM 164

LISTING FOR PART TEST



INPUT



include_prot yes_no

protrusion yes no?

END INPUT



RELATIONS

END RELATIONS





ADD FEATURE (initial number 1)

INTERNAL FEATURE ID 1

TYPE = DATUM PLANE

NAME = RIGHT





FEATURE IS IN LAYER(S) :

01___PRT_ALL_DTM_PLN - OPERATION = SHOWN

01___PRT_DEF_DTM_PLN - OPERATION = SHOWN



END ADD





ADD FEATURE (initial number 2)

INTERNAL FEATURE ID 3

TYPE = DATUM PLANE

NAME = TOP





FEATURE IS IN LAYER(S) :

01___PRT_ALL_DTM_PLN - OPERATION = SHOWN

01___PRT_DEF_DTM_PLN - OPERATION = SHOWN



END ADD





ADD FEATURE (initial number 3)

INTERNAL FEATURE ID 5

TYPE = DATUM PLANE

NAME = FRONT





FEATURE IS IN LAYER(S) :

01___PRT_ALL_DTM_PLN - OPERATION = SHOWN

01___PRT_DEF_DTM_PLN - OPERATION = SHOWN



END ADD





ADD FEATURE (initial number 4)

INTERNAL FEATURE ID 7

TYPE = COORDINATE SYSTEM

NAME = PRT_CSYS_DEF





FEATURE IS IN LAYER(S) :

05___PRT_ALL_DTM_CSYS - OPERATION = SHOWN

05___PRT_DEF_DTM_CSYS - OPERATION = SHOWN



END ADD





if include_prot==yes

add part prot







ADD FEATURE (initial number 5)

!*** ERR: no END ADD statement for ADD on line 0

INTERNAL FEATURE ID 99





GROUP HEAD



NO. ELEMENT NAME INFO

--- ------------- -------------

1 Name Defined

2 Features Defined

3 Construction Defined



NAME = SHAPES

FEATURE BELONGS TO LOCAL GROUP SHAPES







MEMBER OF A GROUP, NAME = SHAPES

LEADING FEATURE OF THE GROUP: ID = 99

LAST FEATURE OF THE GROUP: ID = 79

END ADD

!*** ERR: unmatched END statement encountered





ADD FEATURE (initial number 6)

INTERNAL FEATURE ID 39

PARENTS = 3(#2) 5(#3) 1(#1)



PROTRUSION: Extrude



NO. ELEMENT NAME INFO STATUS

--- ------------ ----------- ------

1 Attributes One Side Defined

2 Section Sk. plane - Surface RIGHT of feat #1 (DATUM PLANE) Defined

3 Direction Defined

4 Depth Blind, depth = 126.501 Defined



FEATURE BELONGS TO LOCAL GROUP SHAPES

SECTION NAME = S2D0001





FEATURE'S DIMENSIONS:

d1 = 177.36 (weak)

d2 = 15.68 (weak)

d3 = 77.20 (weak)

d4 = 126.50



MEMBER OF A GROUP, NAME = SHAPES

LEADING FEATURE OF THE GROUP: ID = 99

LAST FEATURE OF THE GROUP: ID = 79

END ADD





ADD FEATURE (initial number 7)

INTERNAL FEATURE ID 57

PARENTS = 3(#2) 5(#3) 1(#1)



PROTRUSION: Extrude



NO. ELEMENT NAME INFO STATUS

--- ------------ ----------- ------

1 Attributes One Side Defined

2 Section Defined

3 Direction Defined

4 Depth Blind, depth = 108.892 Defined



FEATURE BELONGS TO LOCAL GROUP SHAPES

SECTION NAME = S2D0002



FEATURE IS IN LAYER(S) :

02___PRT_ALL_AXES - OPERATION = SHOWN



FEATURE'S DIMENSIONS:

d5 = 30.00

d6 = 93.26 Dia (weak)

d7 = 72.64 (weak)

d8 = 123.26 (weak)

d9 = 108.89



MEMBER OF A GROUP, NAME = SHAPES

LEADING FEATURE OF THE GROUP: ID = 99

LAST FEATURE OF THE GROUP: ID = 79

END ADD





ADD FEATURE (initial number 8)

INTERNAL FEATURE ID 79

PARENTS = 3(#2) 5(#3) 1(#1)



PROTRUSION: Extrude



NO. ELEMENT NAME INFO STATUS

--- ------------ ----------- ------

1 Attributes One Side Defined

2 Section Defined

3 Direction Defined

4 Depth Blind, depth = 125.487 Defined



FEATURE BELONGS TO LOCAL GROUP SHAPES

SECTION NAME = S2D0003





FEATURE'S DIMENSIONS:

d10 = 60.00

d12 = 189.15 (weak)

d13 = 18.94 (weak)

d14 = 112.59 (weak)

d15 = 125.49



MEMBER OF A GROUP, NAME = SHAPES

LEADING FEATURE OF THE GROUP: ID = 99

LAST FEATURE OF THE GROUP: ID = 79

END ADD



endif





MASSPROP

END MASSPROP
 
Your error comes from adding the line:



add part prot



Why did you add this?



I've tried exactly the same thing & it works OK.



Ed



Here it is: (some code removed for clarity)



...



INPUT

INCLUDE_PROT YES_NO

protrusion yes no?


END INPUT

...

...

...

IF INCLUDE_PROT==YES



ADD FEATURE (initial number 6)

INTERNAL FEATURE ID 158



GROUP HEAD



NO. ELEMENT NAME INFO

--- ------------- -------------

1 Name Defined

2 Features Defined

3 Construction Defined



NAME = 123

FEATURE BELONGS TO LOCAL GROUP 123



MEMBER OF A GROUP, NAME = 123

LEADING FEATURE OF THE GROUP: ID = 158

LAST FEATURE OF THE GROUP: ID = 107

END ADD



ADD FEATURE (initial number 7)

INTERNAL FEATURE ID 64

PARENTS = 1(#1) 4(#2) 6(#3)



PROTRUSION: Revolve



...



MEMBER OF A GROUP, NAME = 123

LEADING FEATURE OF THE GROUP: ID = 158

LAST FEATURE OF THE GROUP: ID = 107

END ADD



ADD FEATURE (initial number 8)

INTERNAL FEATURE ID 107

PARENTS = 1(#1) 4(#2) 64(#7) 6(#3)



CUT: Revolve



...



MEMBER OF A GROUP, NAME = 123

LEADING FEATURE OF THE GROUP: ID = 158

LAST FEATURE OF THE GROUP: ID = 107

END ADD

END IF
 

Sponsor

Back
Top