Announcements

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

Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

4 REPLIES 4
Reply
Message 1 of 5
j.pavlicek
1239 Views, 4 Replies

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

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.
4 REPLIES 4
Message 2 of 5
johnsonshiue
in reply to: j.pavlicek

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
Message 3 of 5
j.pavlicek
in reply to: johnsonshiue

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.
Tags (1)
Message 4 of 5
j.pavlicek
in reply to: j.pavlicek

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.
Tags (1)
Message 5 of 5
j.pavlicek
in reply to: j.pavlicek

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.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report