iLogic dimentions center to center

iLogic dimentions center to center

FeelGoodGirl
Advocate Advocate
313 Views
2 Replies
Message 1 of 3

iLogic dimentions center to center

FeelGoodGirl
Advocate
Advocate

Hi,

 

I'm trying to figure out the best way to add dimensions to the drawing using iLogic. I'm trying to create a model that includes drawings that are always correct and have all the dimensions. I think the only way to achieve this is by programming these dimensions.

 

I have a series of holes that I'm trying to dimension center-to-center. Unfortunately, I can't create an entity for the center. Does anyone have any ideas on how to solve this?

 

This is what i have now:

Dim Sheet_1 = ThisDrawing.Sheets.ItemByName("Sheet1:1")
Dim VIEW1 = Sheet_1.DrawingViews.ItemByName("FrontView")
Dim Face1 = VIEW1.GetIntent("Face1")
Dim Face2 = VIEW1.GetIntent("Face2")
Dim genDims = Sheet_1.DrawingDimensions.GeneralDimensions
Dim linDim1 = genDims.AddLinear("Dimension 1", VIEW1.SheetPoint(0.5, 5), Face1, Face2)

 

FeelGoodGirl_0-1753086480370.png

 

0 Likes
Accepted solutions (1)
314 Views
2 Replies
Replies (2)
Message 2 of 3

WCrihfield
Mentor
Mentor

HI @FeelGoodGirl.  I do not really do a lot of dimensioning by code, but it looks like you may need to include more specific information within Lines 3 & 4, where you are using the 'GetIntent' method.  That method only 'requires' the first input, but it lets us specify 2 more inputs that are 'optional', and sometimes they may be needed to do what you want to do.  There are two versions of that method:

IManagedDrawingView.GetIntent Method (String, PointIntentEnum, CurveChoiceSpec) 

IManagedDrawingView.GetIntent Method (ComponentArgument, String, PointIntentEnum, CurveChoiceSpec) 

...but it looks like you are using the first version.

In that version of the method, the second thing it is asking for is a variation of the PointIntentEnum.  You could try specifying the PointIntentEnum.kAxisEndPointIntent or PointIntentEnum.kAxisStartPointIntent variations.  Do the centerlines shown in the image already exist before placing the dimensions.  Did you add those centerlines by code before that point, using iLogic snippets?  If you added them by code, using the iLogic snippets (IManagedCenterlines.Add), then you may have assigned a name to them.  If that is the case, then I'm thinking that you may be able to attach your dimension intent to the existing centerlines, by specifying the name of the centerline that you created earlier in your overall code process...but I am not sure about that yet without testing.  In theory, that would attach & associate the dimension with the centerline objects, rather than the actual 'Edge' or 'Face' objects from the model.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 3

Curtis_Waguespack
Consultant
Consultant
Accepted solution

@FeelGoodGirl , I think a work point at the center of each hole would be best for this situation.

 

Dim Sheet_1 = ThisDrawing.Sheets.ItemByName("Sheet:1")
Dim VIEW1 = Sheet_1.DrawingViews.ItemByName("VIEW1")
Dim genDims = Sheet_1.DrawingDimensions.GeneralDimensions

Dim PT1 = VIEW1.GetIntent("Work Point1")
Dim PT2 = VIEW1.GetIntent("Work Point2")
Dim PT3 = VIEW1.GetIntent("Work Point3")
Dim PT4 = VIEW1.GetIntent("Work Point4")
Dim PT5 = VIEW1.GetIntent("Work Point5")

Dim PlacementPT = VIEW1.SheetPoint(0.5, -4)

genDims.AddLinear("Dimension 1", PlacementPT, PT1, PT2)
genDims.AddLinear("Dimension 2", PlacementPT, PT1, PT3)
genDims.AddLinear("Dimension 3", PlacementPT, PT2, PT4)
genDims.AddLinear("Dimension 4", PlacementPT, PT3, PT5)

 

You can right click when creating the workpoint and choose Loop Select

Curtis_Waguespack_1-1753120389041.png

 

In my example patterned the hole and work point from the center out, but they could be created individually also

 

Curtis_Waguespack_0-1753120324433.png

 

Curtis_Waguespack_2-1753120631931.png

 

Hope that helps,

Curtis

 

EESignature

0 Likes