Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Macro to Create Point in Isolated Surfaces

Status
Not open for further replies.

vikt

Mechanical
Mar 13, 2013
52
Hi everyone,
i have a product with multiple L Shaped bracket.
Problem is, all these brackets are Isolated surface.
Now each bracket has a hole( some may have two ).
I need to create a point to the center of this hole.

Request all to provide some solution or pointers, where i can try or create something.

Regards,
Vik
 
Replies continue below

Recommended for you

would it work if you took a boundary of the bracket surface, disassemble it into domains, loop through the result and If there is a circle curve present, create a point on circle?...

regards,
LWolf
 
Hi LWolf,
I understood disassemble, loop and circle curve.
When I tried selecting the whole surface and disassembling it, after disassemble, all entities are coming as Surface.1,Surface.2 etc.
How can i select the boundary or edge, so that i can get the exact whole surface ?

Vik
 
take boundary of your Isolated bracket surface. the disassemble should be performed on the boundary curve (the boundary curve should consist of at least 2 domains, the hole and the outer boundary of the bracket surface... )

regards,
LWolf
 
I guess you could do: disassemble (=> surfaces), boundary(=> edges), now loop through edges to get the "circled" ones.
Is it really worth scripting this? Do you have that many points to create? Are we talking hundreds, thousands?
 
Yes, i have hundreds of brackets in one product and there are multiple such products.
Selecting each bracket and creating boundary->Disassemble-> and then center point won't work. That's why an automation approach is needed.

Vik
 
Is it possible to post here such a bracket to have a go at it?
 
I have given you the pointers, now you just need to implement it in form of a script... :)

regards,
LWolf
 
Hi,
ferdo this will work if i have a solid body.
But here i have an isolated surface. When i disassemble it, i get approx. 50 more surfaces.
From there it is very difficult to find the surface which represent the hole in the bracket.
This is what i have so far (manual approach)
1. Select the isolated surface and disassemble
2. Identify and Manually Select the surface with hole and create Boundary
3. Disassemble the boundary
4. Now Join the boundary edge of hole and create a point

:( :(

As you can see, this is tedious approach.
Let me know if we can automate this, just need the pointers, so i can start developing the script.

Regards,
Vik
 
Okay, so here is final solution.

1.Disassemble the master surface.
2.Create Boundary for each Isolated Surface(except the master surface)
3.Disassemble each boundary feature
4.You will get Line and Circles, loop through circles and Join them
5.If join is created, it's a full circle i.e a hole, use this Join to create point

I am working on automating it :)

Thanks LWolf for the idea.
Also everyone else who gave their valuable feedback.

Vik
 
Vikt, why don't you create a boundary for the master surface straight away?
Dissassemble into domains, not cells-- you will get full circles.
could you provide with an example file?
regards,
LWolf
 
Hi LWolf,
sorry for the late reply.
I tried to create a boundary for the isolated master surface, but getting below error.
"Boundary operator: the selected body is closed, it has no boundary.
It is the case of a sphere as an example.
Select an open body."

It's an L shape profile, with holes.

regards,
vikt
 
can you post a picture of your solid?

if you have an L shape with a hole, maybe searching for all face and trying to create an axis with it will help you find what you need,if the axis construction is ok then get the boundaries of that face and build centre points.

Eric N.
indocti discant et ament meminisse periti
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor