Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Linear diameter using ilogic

manu.marjanen
Advocate

Linear diameter using ilogic

manu.marjanen
Advocate
Advocate

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

 

0 Likes
Reply
Accepted solutions (1)
550 Views
2 Replies
Replies (2)

chandra.shekar.g
Autodesk Support
Autodesk Support

@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



0 Likes

theo.bot
Collaborator
Collaborator
Accepted solution

@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

 

0 Likes