add a breakout to the front view of a drawing using iLogic.

add a breakout to the front view of a drawing using iLogic.

ysbaodnj
Enthusiast Enthusiast
162 Views
1 Reply
Message 1 of 2

add a breakout to the front view of a drawing using iLogic.

ysbaodnj
Enthusiast
Enthusiast

I would like to add a breakout to the front view of a drawing using iLogic.
I want to let the user choose the sketch and depth for creating the breakout on the fly.
When I run the rule, I want to be prompted to draw a sketch, and when I end the sketch, I want a command to select the depth to be executed.

The code below already has a sketch in the front view, and a breakout is created using one of the curves existing in the view as the depth... (found in another article)

 

Sub ADNTest()

    Dim oDoc As DrawingDocument
    Set oDoc = ThisApplication.ActiveDocument
    
     Dim oSheet As Sheet
    Set oSheet = oDoc.ActiveSheet
    
     Dim oView As DrawingView
    Set oView = oSheet.DrawingViews(1)
    
   Dim oSketch As Sketch
   Set oSketch = oView.Sketches(1)
   
   
  'Create a  profile then revolve it
    Dim oProfile As Profile
    Set oProfile = oSketch.Profiles.AddForSolid

     Dim oDCurve As DrawingCurve
     'Dim oDCurve As GeometryIntent
     Set oDCurve = oView.DrawingCurves.Item(1)
     
     Dim oPointIntent As Point2d
     Set oPointIntent = oDCurve.StartPoint
    
     Dim oIntent1 As GeometryIntent
     Set oIntent1 = oSheet.CreateGeometryIntent(oDCurve, oPointIntent)
     
    'Add break out view
    Dim oBreakOut As BreakOutOperations
    'Set oBreakOut = oView.BreakOutOperations.Add(oProfile, oDCurve, 0, True)
    Set oBreakOut = oView.BreakOutOperations.Add(oProfile, oIntent1, 0.5, True)
 
End Sub


Is there anyone who can give me the answer I want..?

0 Likes
163 Views
1 Reply
Reply (1)
Message 2 of 2

FINET_Laurent
Advisor
Advisor

Hi @ysbaodnj,

 

For this kind of behaviour I would propably place some handles on certain events. ApplicationEvents.OnNewEditObject looks promising. Here is few link you can read for yourself with what you are looking for :

Inventor 2023 Help | User Interaction | Autodesk 

Inventor 2022 Help | ApplicationEvents.OnNewEditObject Event | Autodesk

 

Kind regards,

FINET L.

If this post solved your question, please kindly mark it as "Solution"

If this post helped out in any way to solve your question, please drop a "Like"

@LinkedIn     @JohnCockerill

0 Likes