Reply

Create a block and chanfers

I'm new to api in SE.

 

I'm trying to create a block, using 2 planes (one for top, another for bottom), and a profile (it can be diferente from a parallelepiped), and then create some chanfers.

 

What I intend to do in my api.

 

1- Select the planes

2-Select the profile.

 

Then my API create an extrude, up to planes (2 directions), and after that, i need to create chanfers on the edges (only in the extrude direction).

Capture.PNG

 

 

Is this possible to do?

 

Tiago
8 REPLIES

Re: Create a block and chanfers

Can anybody Help?

 

Is this possible to do in automation?

Tiago

Re: Create a block and chanfers

Yes, it is possible.

 

To create extrusion:

https://www.youtube.com/watch?v=SmZ5U_g3nfg

 

To create chamfers you can use the cutout command or method SolidEdgePart.Chamfers.AddEqualSetback.

Cutout command:

https://www.youtube.com/watch?v=RZSk6ML8PnY

 

Chamfer method:

https://docs.plm.automation.siemens.com/docs/se/108/api/SolidEdgePart~Chamfers_members.html



==========================
Kabir Costa
Industrial Designer
kabircosta@gmail.com

Re: Create a block and chanfers

[ Edited ]

Really nice Kabir.

 

One question. Imagine that I Have several sketchs in my part, and I need that my macro ask user to select the desired profile to make the extrusion, and the same for the limits of extrusion. Is this possible?

 

In your videos, you select the drawn sketch in macro. 

Tiago

Re: Create a block and chanfers

For this, we will go to another level of difficulty:

You will need to know two methods:

SolidEdgeFramework.Command (to create a new command)
SolidEdgeFramework.Mouse (For the user to use the mouse)

https://github.com/SolidEdgeCommunity/Samples/tree/master/General/MouseEvents/cs

 

To select the sketch (or profile) you need to create a filter for your mouse to select only sketch elements.

The extrusion depth can be set manually by typing the value or subtracting the sketh position from the target point.



==========================
Kabir Costa
Industrial Designer
kabircosta@gmail.com

Re: Create a block and chanfers

Humm. In CATIA looks easier to do it.
Do you have any example where you did something similar?
Tiago

Re: Create a block and chanfers

Unfortunately not.



==========================
Kabir Costa
Industrial Designer
kabircosta@gmail.com

Re: Create a block and chanfers

And across the internet, anything?
It looks quite hard to do it.
Tiago

Re: Create a block and chanfers

An alternative to what @KabirCosta has suggested fro mouse picking would be using selection set where the user picks profiles and the limiting planes before starting the program which then checks the contents of the selection and determines the types of objects - sketch, planes, etc. - and uses them to create the protrusion.

Subsequent, edge selection for chamfers can get very tricky.

  

I will try to write a sample program to do exactly this if I find time, but Kabir's tutorials should provide you everything needed to put this together.