Alignment of center mark - Implement an API.

Alignment of center mark - Implement an API.

punam_bansode
Contributor Contributor
200 Views
5 Replies
Message 2 of 6

Alignment of center mark - Implement an API.

punam_bansode
Contributor
Contributor

I am working for the Automation of drawing generation process. in this I am able to create a center mark on the particular view of the drawing. but I want to aligned that center mark as per the view edge. as this is possible manually as shown in image.

Screenshot 2025-06-12 103002.png

Please help me to this alignment using iLogic API.  

 

 

Screenshot 2025-06-12 103657.pngScreenshot 2025-06-12 103920.png

0 Likes
201 Views
5 Replies
Replies (5)
Message 1 of 6

punam_bansode
Contributor
Contributor

Dim PrintDoc As DrawingDocument = ThisDoc.Document

Dim POSheet = PrintDoc.ActiveSheet

Dim oView As DrawingView = ActiveSheet.View("6").View

Dim ACLSettings As AutomatedCenterlineSettings = PrintDoc.DrawingSettings.AutomatedCenterlineSettings ACLSettings.ApplyToCylinders = True

ACLSettings.ApplyToHoles = True

ACLSettings.ApplyToRevolutions = True

ACLSettings.ApplyToRectangularPatterns = True

ACLSettings.ProjectionNormalAxis = True

ACLSettings.ProjectionParallelAxis = True

oView.SetAutomatedCenterlineSettings(ACLSettings)

0 Likes
Message 3 of 6

joaquim.moral
Community Manager
Community Manager

Hi @punam_bansode!
Thanks for participating in the Autodesk Community, and welcome to Community Central.


Please tell us what Autodesk software you're using so we can move your question to the appropriate forum.

Thanks!


You found a post helpful? Then feel free to give likes to these posts!
Your question got successfully answered? Then just click on the 'Mark as solution'

¿Te ha parecido útil este post? ¡Deja un like!
¿Tu pregunta ha sido solucionada? Selecciona 'Marcar como solución' y ayuda a las demás a encontrar fácilmente la información.


Joaquim Moral
Senior Community Manager

0 Likes
Message 4 of 6

punam_bansode
Contributor
Contributor

Hi @joaquim.moral ,

Thank you for the quick reply.

I am using Autodesk Inventor software for 3D modeling and Drawing automation using iLogic API.

 

0 Likes
Message 5 of 6

WCrihfield
Mentor
Mentor

Hi @punam_bansode.  You should probably read through the following pre-existing Inventor Programming forum discussion that I helped someone else out with a while back, because it was essentially about the same thing.  You will see several code based attempts to accomplish something similar to this.  In the end, a satisfactory code based solution could not be found, so that user created an Inventor Ideas post about it, in an attempt to get something along these lines introduced into the Inventor API &/or iLogic API.

https://forums.autodesk.com/t5/inventor-programming-ilogic/automatic-centermark-alignment/m-p/133199... 

And below is a direct link to that Inventor Ideas post also:

https://forums.autodesk.com/t5/inventor-ideas/centermark-properties/idi-p/13328637 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 6 of 6

Andrii_Humeniuk
Advisor
Advisor

Hi @punam_bansode .
For the iLogic code below to work, you need to run it, select the DrawingView, and then select the alignment line.
I added your code snippet (line 8-17) to the code to create Centermark.

Dim oInvApp As Inventor.Application = ThisApplication
Dim oDDoc As DrawingDocument = TryCast(oInvApp.ActiveDocument, DrawingDocument)
If oDDoc Is Nothing Then Exit Sub
Dim oCM As CommandManager = oInvApp.CommandManager
Dim oView As DrawingView = oCM.Pick(SelectionFilterEnum.kDrawingViewFilter, "Select View...")
If oView Is Nothing Then Exit Sub
	
Dim ACLSettings As AutomatedCenterlineSettings = oDDoc.DrawingSettings.AutomatedCenterlineSettings
With ACLSettings
	.ApplyToCylinders = True
	.ApplyToHoles = True
	.ApplyToRevolutions = True
	.ApplyToRectangularPatterns = True
	.ProjectionNormalAxis = True
	.ProjectionParallelAxis = True
End With
oView.SetAutomatedCenterlineSettings(ACLSettings)

Dim oSheet As Sheet = oView.Parent
Dim oSelectSet As SelectSet = oDDoc.SelectSet
Dim oColl As ObjectCollection = oInvApp.TransientObjects.CreateObjectCollection()
Call oSelectSet.Clear()
For Each oMark As Centermark In oSheet.Centermarks
	Try
		If Not oMark.AttachedEntity.Geometry.Parent Is oView Then Continue For
		Call oColl.Add(oMark)
	Catch : End Try
Next
Call oSelectSet.SelectMultiple(oColl)
Call oCM.ControlDefinitions("DrawingCenterMarkAlignToEdgeCtxCmd").Execute2(True)

 

Andrii Humeniuk - CAD Coordinator, Autodesk Certified Instructor

LinkedIn | My free Inventor Addin | My Repositories

Did you find this reply helpful ? If so please use the Accept as Solution/Like.

EESignature

0 Likes