Placing an angle on a profile where the intents are identical

Placing an angle on a profile where the intents are identical

harvey_craig2RCUH
Advocate Advocate
920 Views
13 Replies
Message 1 of 14

Placing an angle on a profile where the intents are identical

harvey_craig2RCUH
Advocate
Advocate

I can place the angle of the bore with the UI:

Screenshot 2024-08-07 151836.png

 I can use the UI to select the bore which gets the face:

Screenshot 2024-08-07 151949.png

 The bottom line is identified as the same face. Therefore how do I pull an angle on here? This is what I have tired:

Dim HYD_A4_1 = ThisDrawing.Sheets.ItemByName("HYD-A4:1")
Dim VIEW1 = HYD_A4_1.DrawingViews.ItemByName("VIEW1")
Dim Face2 = VIEW1.GetIntent("Face2")
Dim genDims = HYD_A4_1.DrawingDimensions.GeneralDimensions
ThisDrawing.BeginManage()
If True Then 
	Dim Length = genDims.AddAngular("Dimension 1", VIEW1.SheetPoint(-0.1, 0.5), Face2)
End If
ThisDrawing.EndManage()

I am aware that I probably need an intentTwo to be able to pull an angle but this identical to my first intent as it's the same face. 

Here is my error with that rule if it's relevant:

harvey_craig2RCUH_0-1723041716144.png

How do I correctly place this angle with iLogic?

 

Thanks,

Harvey 

 

 

0 Likes
Accepted solutions (1)
921 Views
13 Replies
Replies (13)
Message 2 of 14

Frederick_Law
Mentor
Mentor

Place the angle in UI.  Check what the angle dimension connected to with code.

My guess is they're projected lines.

0 Likes
Message 3 of 14

harvey_craig2RCUH
Advocate
Advocate

How do I check what code my UI angle is connected to?

0 Likes
Message 4 of 14

Frederick_Law
Mentor
Mentor

Make rule to check selected object and write info to log with: Logger.Info

Or run iLogic debug with Visual Studio.

0 Likes
Message 5 of 14

harvey_craig2RCUH
Advocate
Advocate

That first option sound more well suited. How would I access something like that? I've never used the logger so something in a msgbox would do.

 

Dim oDrawDoc As DrawingDocument = ThisApplication.ActiveDocument
Dim oSelectSet As SelectSet = oDrawDoc.SelectSet

MsgBox(oSelectSet....)?
0 Likes
Message 6 of 14

Frederick_Law
Mentor
Mentor
0 Likes
Message 7 of 14

Frederick_Law
Mentor
Mentor
0 Likes
Message 8 of 14

Curtis_Waguespack
Consultant
Consultant

@harvey_craig2RCUH , I think for this conical face we would need to place the angle dimension by selecting 3 points.

 

You can place the dimension manually to see the required input points


something like this for a view of cube with a conical cutout

Curtis_Waguespack_0-1723127935815.png Curtis_Waguespack_1-1723128003740.png

 

I think we might need to use some nearpoint helper geometry similar to what Mike Deck showed us here:

https://forums.autodesk.com/t5/inventor-programming-ilogic/problem-creating-a-radius-for-a-spherical...

 

@MjDeck could you help us with this?

 

See attached files, where the desired result would be this:

 

Curtis_Waguespack_2-1723128239418.png


I attempted to do this using PointIntentEnums and by specifying a nearpoint

 

This doesn't work, but doesn't error

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

Dim ViewPt_BottomLeft = VIEW1.SheetPoint(0, 0)
Dim ViewPt_RightMid = VIEW1.SheetPoint(1, 0.5)
Dim ViewPt_TopLeft = VIEW1.SheetPoint(0, 1)

Dim PlacementPoint = VIEW1.SheetPoint(-0.1, 0.5)

Dim pt1 = VIEW1.GetIntent("Face0",, nearPoint := ViewPt_BottomLeft)
Dim pt2 = VIEW1.GetIntent("Face0", nearPoint := ViewPt_RightMid)
Dim pt3 = VIEW1.GetIntent("Face0", nearPoint := ViewPt_TopLeft)

Dim angDim1 = genDims.AddAngular("Angular Dim 1", PlacementPoint, pt1, pt2, pt3)

 

EESignature

0 Likes
Message 9 of 14

Frederick_Law
Mentor
Mentor

https://help.autodesk.com/view/INVNTOR/2023/ENU/?guid=GUID-A27A7162-50E7-42F7-B16A-5287BD3F3B69

AddAngularMethod that creates an angular dimension. Valid intent combinations are Three points, Two non-parallel linear curves, One arc curve.
0 Likes
Message 10 of 14

MjDeck
Autodesk
Autodesk

Hi @Curtis_Waguespack , yes I hope it's possible to make the nearPoint argument work in this case.
Could you post the part referenced by your drawing:  ilogic Angle on Cone.ipt ?


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes
Message 11 of 14

Curtis_Waguespack
Consultant
Consultant

 

oops! sorry, I got in a hurry and attached the wrong file. I fixed that in the post above and here is a direct link.

ilogic Angle on Cone.ipt 

 

Thanks for taking a look Mike!

EESignature

0 Likes
Message 12 of 14

MjDeck
Autodesk
Autodesk
Accepted solution

Thanks @Curtis_Waguespack .

There seems to be a defect with the three-point case. It creates a dimension, but it's not visible. It seems like it should throw an error. I'll take a more in-depth look at it.

But I got it to work with two entities. These would be the two lines of the cone profile. Here's a modified version of your rule and drawing.

 

 

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

ThisDrawing.BeginManage()

Dim ViewPt_BottomMid = VIEW1.SheetPoint(0.5, 0)
Dim ViewPt_TopMid = VIEW1.SheetPoint(0.5, 1)

Dim PlacementPoint = VIEW1.SheetPoint(-0.2, 0.5)

Dim pt1 = VIEW1.GetIntent("Face0", nearPoint := ViewPt_BottomMid)
Dim pt2 = VIEW1.GetIntent("Face0", nearPoint := ViewPt_TopMid)

Dim angDim1 = genDims.AddAngular("Angular Dim 1", PlacementPoint, pt1, pt2)
ThisDrawing.EndManage()

 

 

In this case, pt1 and pt2 would actually be lines. So line1 and line2 would be more accurate variable names.

@harvey_craig2RCUH , please try something like this in your drawing.

 


Mike Deck
Software Developer
Autodesk, Inc.

Message 13 of 14

Curtis_Waguespack
Consultant
Consultant

@MjDeck, yeah I was seeing evidence of the "invisible" dimension points when I modified the model to orphan the annotation, but I wasn't sure what I was seeing.

 

In any case your example is probably more in line with what @harvey_craig2RCUH's geometry involves since it is an open conical cut ( vs. my example with an apex).

 

Thanks again!

@harvey_craig2RCUH, the example that Mike posted uses some points on the view as helper geometry in order for the GetIntent function to determine which drawing curve to get from the conical face.

 

Those points are used an optional nearpoint specifiers as shown in the tool tip seen when hovering over the GetIntent function:

Curtis_Waguespack_0-1723131919306.png

 

 

I hope that helps makes some sense for how this is working.

 

EESignature

0 Likes
Message 14 of 14

harvey_craig2RCUH
Advocate
Advocate

Thank you @MjDeck, works flawlessly. Thank you @Curtis_Waguespack too for your input!