Announcements

Starting in December, we will archive content from the community that is 10 years and older. This FAQ provides more information.

Automated centerline orientation for holes in circular pattern (more than 1 lvl)

j.pavlicek
Collaborator
Collaborator

Automated centerline orientation for holes in circular pattern (more than 1 lvl)

j.pavlicek
Collaborator
Collaborator

Hi,

 

I have part - it's plate with multiple flanged connections. Basicaly it's circular pattern of holes. Each of these holes has few another smaller holes around itself (for bolts). So I create one hole with circular pattern of small holes around it and then create another circular pattern from them (one big hole + circ. pattern of small holes). As you can see in images below.

 

circular-patter01.pngcircular-patter02.png

 

But when i use automated centerlines in drawing, only source features of the first pattern have centerline in desired orientation.

 

What I get.What I get.What I wantWhat I want

I know, that I can make these centerlines manually, but please NO! There are parts with hundreds of holes!

 

 



Inventor 2022, Windows 10 Pro
Sorry for bad English.
Reply
1,244 Views
4 Replies
Replies (4)

johnsonshiue
Community Manager
Community Manager

Hi! I am not aware of an automated way to create center patterns. You will need to use Center Pattern command to create the center marks. Please see the following Help document.

 

https://knowledge.autodesk.com/support/inventor-products/learn-explore/caas/CloudHelp/cloudhelp/2018...

 

Many thanks!



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
0 Likes

j.pavlicek
Collaborator
Collaborator

Thanks for advice. These are very bad news for me. Just now I have part with 20x8 and 24x10 holes (it's 180 and 284 clicks = crazy).

 

Is there way how to automate it with VBA?

 

I think about this approach (kind of pseudocode):

 

 

In SelectedView Do{

For i=0 to CirclePattern2.Element.Count -1 Do SelectTool("Centered Pattern"){ //Like click on the "Centered Pattern" icon CirclePattern2.Element[i].Hole2.Edge.Select //Select the big hole With Each Element In CirclePattern1 Do //For all small holes Element.Hole1.Edge.Select //Select the small hole End With Create //Confirm Centered pattern lines command } End For
}

 

 

But I have no Idea how to call the Centered pattern tool and address edges in VBA.

 

 



Inventor 2022, Windows 10 Pro
Sorry for bad English.
0 Likes

j.pavlicek
Collaborator
Collaborator

I very little experience with programing and even less with VBA but I found this:

 

Centerlines.AddCenteredPattern Method

Parent Object: Centerlines

Description

Method that creates a new centerline pattern. The centerline created with this method is kCenteredPatternCenterline type.

Syntax

Centerlines.AddCenteredPattern( PatternCenter As GeometryIntent, CenterEntities As ObjectCollection, [CentermarkStyle] As Variant, [Layer] As Variant, [Closed] As Boolean ) As Centerline

Parameters

NameTypeDescription
PatternCenterGeometryIntentInput GeometryIntent that defines the a circular or elliptical drawing curve that defines the center of the pattern.
CenterEntitiesObjectCollectionInput ObjectCollection object that contains the set of entities that define the points the centerline passes through. Valid objects for input are GeometryIntent objects that reference circular or elliptical drawing curves, and center marks.
CentermarkStyleVariantObject that specifies the center mark style to use for the centerline. If not specified, the style defined by the active standard is used.
LayerVariantObject that specifies the layer to use for the centerline. If not specified, the layer defined by the active standard is used.
ClosedBoolean

Input B

oolean that indicates if the centerline should be closed or not.

 

 

DrawingView.DrawingCurves Property

Parent Object: DrawingView

Description

Property that returns all the drawing curves within the drawing view optionally filtered to the input model object. This property returns Nothing for draft views.iew object represents a drawing view on a sheet.

Syntax

DrawingView.DrawingCurves( [ModelObject] As Variant ) As DrawingCurvesEnumerator

Property Value

This is a read only property whose value is a DrawingCurvesEnumerator.

Parameters

NameTypeDescription
ModelObjectVariantOptional input object that specifies the object from the model for which the corresponding drawing view curves need to be retrieved. This could be an Edge, Face, PartFeature, Sketch, SketchEntity, Sketch3D, SketchEntity3D, ComponentOccurrence, or the proxies to any of these. If not specified, all the edges from the drawing view are returned.

____________________________________________________________________________________________________

 

Conclusion:

 

So it seems It's possible to get lines according to part feature (I assume that pattern is PartFeature), and these pass as argument to add.CenteredPattern()

 

I see these problems:

  1. I don't know how to address the PartFeature
  2. I don't know how to get proper intent from it
  3. I don't know how to even extract previous from selected geometry in a drawing (In case of this approach: Run macro, select center hole, OK, all holes around center hole in rectangle)

Thanks for any advice.



Inventor 2022, Windows 10 Pro
Sorry for bad English.
0 Likes

j.pavlicek
Collaborator
Collaborator

Relevant topic: VB.net vs iLogic for Automated Centerlines giving different results - VB.net Automated Centerlines h...

There is code from @dtimm8RCUM  which creates centerlines for holes in pattern around Base View centre.



Inventor 2022, Windows 10 Pro
Sorry for bad English.
0 Likes