Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
manu.marjanen
551 Views, 2 Replies

Linear diameter using ilogic

How to modify this code to create a linear diameter?

Dim Sheet_1 = ThisDrawing.Sheets.ItemByName("Sheet:1")
Dim view_A = Sheet_1.DrawingViews.ItemByName("A")
Dim Face0 = view_A.GetIntent("Part:1", "Face0") 'Part:1 Assign name "Face0"
Dim Z_Axis = view_A.GetIntent("Z Axis") 'Assembly ZAxis

Dim genDims = Sheet_1.DrawingDimensions.GeneralDimensions
Dim linDim1 = genDims.AddLinear("Dimension 1", view_A.SheetPoint(-0.5, 1.05), Face0)

manumarjanen_0-1632295734407.png

 

@manu.marjanen,

 

Please refer below forum discussion for creating linear diameter dimension.

 

https://forums.autodesk.com/t5/inventor-forum/creating-linear-diameter-dimension-using-api/td-p/6238...

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



theo.bot
in reply to: manu.marjanen

@manu.marjanen 

 

you just need to add the dimension style to you code:

 

Dim linDim1 = genDims.AddLinear("Dimension 1", view_A.SheetPoint(-0.5, 1.05), Face0,kDiametricDimensionType)

 

theobot_0-1632835747415.png

theobot_1-1632836110075.png