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.

Dynamic Sketches

conrat

New member
Is it possible to programmatically change the external sketch that an
extrusion references? I know how to do this by hand, but need to
do it in the program.



Sort of like swapping parts from an interchange assembly programmatically, but sketches instead.



Any help will be appreciated.

Thanks,

Jim
 
To swap an external sketch of an extrusion, you do an "Edit
Definition", then click on the the new sketch and the extrusion updates
to the new external sketch. This is what I mean "by hand".



I want to control this using relations and Pro/Program, if possible.



Jim
 
Hey,





I think you need to be a bit more specific in your question.


For example do you want it to be created by a layout so you change all the dimensions in there and then regenerate the model or


Do you want to regenerate and get the question eg 'Hing open Y or N' so when you type Y enter the angle between the two flanges becomes 180
 
Okay, let me start over.



I am creating a part that has a number of different possible sketches. Below is a rough example of the sketches.



Sketch 1: ___________________________



Sketch 2: |_________________________|



Sketch 3....4....5....



To do this, I would typically create a part using the first
sketch. Then I would add the legs on the end as seperate
extrusions. I would then use Pro/Program to supress the legs I do
not need.



However, WF2 allows you to use external sketches to create an
extrusion. You can then "swap" the external sketch for another
one. You do this by editing the definition of the
extrusion. You then click the "Placement" button and the external
sketch is listed (with an unlink button next to it). If you click
on the sketch name, you can select an alternate external sketch and the
extrusion will update to use the new sketch, completely redefining the
extrusion without having to recreate another extrusion or mess with the
program to supress these features.



If there was a way to do this programatically using relation and
Pro/Program, I would only need to create the external sketches for the
various profiles, then "swap" in the correct sketch in my code.



Think of it like an interchange assembly. If you have two parts
in an interchange assembly, you can set a string parameter in your
relations, such as:



my_part = "part1.prt"



Then, you can edit the program from:



ADD PART PART1



to



ADD COMPONENT (my_part)



then, if you need to swap out the original for another, you can change
the variable value of my_part to another part in the interchange
assembly. Pro/Program will read the "ADD COMPONENT..." line and
use the value of the string variable. This allows you to
programatically control the assembly of similar parts.



I am looking to do something similar with the external sketches.
I know of more labor intensive ways of doing this, but am looking for
an efficient method. This seemed to be a good option if it can be
done.



I hope this clears up my questions some. Sorry if it is confusing.



Thanks,

Jim
 
I cant help you with the sketch optionbut have you considered creating a feature for every sketch you have and then supress the unwanted features with Pro/Program?


I had to use this when making a program for springs to control left- or right-hand coil direction, since the direction is a flag and not a parameter. I guess it similar with the sketch.
 
See, the main problem I have run into is, I am driving this part from
many parameters entered through a text file using the "Read File"
option. There are over a 100 params. And each of these
drive a number of features, allowing for a huge variance in product
configuration from a text file.



I am worried about creating multiple extruded features, as there are
many cutouts added to the part and I am worried that multiple
extrusions will require replicating these cuts for each base extrusion
and also I am worried about lost references.



I did figure out how to do it, at least somewhat. I broke the
sketches down into their most basic parts and identified the
similarities. I created extrusions for each of the sketches,
ensuring they all touch. I then supress the extrusions I do not
need.



Remarkable, I can convert this part to a sheet metal part and it picks
up on which extrusions are "on". Now the trick is to add edge
bends and ensure I am not adding one to an edge that is supressed.



I wish Pro/E had an option to quietly supress failed features, where
specified. Or automatically add the edge bends to a converted
sheet metal part. I noticed Inventor seems to do this. The
biggest problem with my method is I have to constantly keep track of
which "legs" of the extrusion are supressed, so I can supress the
corresponding edge bends.



But it is working...



Thanks a bunch.

Jim
 

Sponsor

Back
Top