Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Help creating BreakOut View

8 REPLIES 8
SOLVED
Reply
Message 1 of 9
CadUser46
1025 Views, 8 Replies

Help creating BreakOut View

Im trying to emulate a practise that we have for our revolved bodies.  The base view is created on its side (see attachment) and then we use breakout to select what must be the mid point (or maybe end point?) of the end curve.  This then creates what looks like a section view, without the need for the original end view.

 

My problem is i dont understand the DepthSource parameter. I think im correct in saying i should be picking this as a Geometry Intent object but i keep getting an error.  I tried setting it to item(1).centerpoint/midpoint but then i get a type error.

 

Also what is the best way to identify which drawing curve is which? I was trying to look for an example of a selectset that would allow me to pick the line then report the item number but i'll need to spend some more time for this.  Right now im just guessing its item(1) as it lists them left to right?

 

    '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)
    
    'Add break out view
    Dim oBreakOut As BreakOutOperations
    Set oBreakOut = oView.BreakOutOperations.Add(oProfile, oDCurve, 0, True)

 

 

 


Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.

---------------------------------------------------------------------------------------------------------------------------
Inventor 2010 Certified Professional
Currently using 2023 Pro
8 REPLIES 8
Message 2 of 9
xiaodong_liang
in reply to: CadUser46

Hi,

 

the drawing curve is not a geometry intent. you need to create the intent by the curve. 

 

With the code below, the breakout is created, BUT the method BreakOutOperations.Add still popped out a failure. The behavior is strange to me. I will dig into futher.

 

in addition, you cannot assume the first curve is the left one. It depends on how the drawing curves are generated from the model. So the order is unknown unless you iterate the curves to get their index. but if you want to get the corresponding curves from a specific model, you can use DetailDrawingView.DrawingCurves (ModelObject). the argument ModelObject could be:

 

Edge, Face, PartFeature, Sketch, SketchEntity, Sketch3D, SketchEntity3D, ComponentOccurrence, or the proxies to any of these. If not specified, all the edges from the drawing view are returned.

 

 

 

 

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

 

Message 3 of 9
CadUser46
in reply to: xiaodong_liang

Thanks Xiaodong.  I will try this again when i get a chance.  Interestingly that might work out as a more robust method for me as my object will always be a revolved body with two endfaces.  If i can just assume endface(1).edge(1) will always exist i wont need to iterate to find it.

 

While on that subject can you suggest the best method to identify which edge is which, i am struggling with doing this as the same problem comes up when i need to add dims to specific edges.


Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.

---------------------------------------------------------------------------------------------------------------------------
Inventor 2010 Certified Professional
Currently using 2023 Pro
Message 4 of 9
xiaodong_liang
in reply to: CadUser46

Hi,

firstly, I finally logged the issue #1518660 : BreakOutOperations.Add throws exception but the breakout is created.

 

I do not think it is a safe way to assume the index of the edge is fixed. In most cases, it might be in the order, but it is not reliable。

 

if you want to identify the edges from one feature/model, use DrawingView.DrawingCurves (i made a typo in last message).

 

if you want to get a specific edge, the best is to store some info to the edge in advance, such as attribute, but this mean you will still iterate each edge to add the info.

 

or, could you provide more demo files with your revolved body? I can check if there is any reliable information that can be used to identify.

Message 5 of 9
CadUser46
in reply to: xiaodong_liang

Xiaodong. 

 

This is part of a bigger project im working on where i have a separete macro to create the ipt file in the first place.  Since i am in complete control of the creation of the source file for the base view this gives me the opportuniy to apply your suggestion.

 

If you could please demostrate exactly how i would add some attribute then retrieve it at the drawing phase i would be very grateful.  I have attached a demo file. 

 

It will always be a revolved body but could be any combination of pin, box or flange.  I just need a method to grab any one of the two ends.

 

Thanks


Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.

---------------------------------------------------------------------------------------------------------------------------
Inventor 2010 Certified Professional
Currently using 2023 Pro
Message 6 of 9
xiaodong_liang
in reply to: CadUser46

Hi,

 

Thanks for the model. You actually wanted to know which edge is at the end of the shape, i.e. the outmost edge of cap face.  next get the corresponding curve in the drawing view. So you did not know which edge you can add attribute. In fact, if you had known, you would not care about the index/attribute at all. While what I thought is: you have known the edge already in *.ipt.

 

Feature has the property EndFaces, but it is empty with your revolved feature. API help says:
Property that returns the set of that cap one end of the revolution that are coincident with the sketch plane. The end faces are those not coincident to the sketch plane of the feature's profile. In the case of a symmetric revolution these faces are the ones on the negative normal side of the sketch plane. In the cases where there aren't any end faces this property will return Nothing.

 

after much investigations, I am starting to doubt the possibility the solution would exist.

 

If the normal of cap faces are always parallel to the revolved axis, we could check every face and filter out the faces whose normal is parallel to axis and one point locates on the plane of the ends.

 

However, if the normal of cap faces are arbitrary, even the face is not planar, or the outmost is edge only, it will be hard to know which face/edge is a kind of “cap”. You can FindUsingRay to get the first face/edge which hits the ray firstly, but it is a question how many rays are required to check a body.

 

If I find a workaround, I will get back.

 

 

 

 

 

Message 7 of 9

Hi,

 

I did not find a solution:(

 

In addition, to clarify: EndFaces refers to the end face such as the one shown below. It is NOT a face of cap actually. if the revolved feature is 360 deg, EndFaces is empty.

 

normally, the cap face could be got from SideFaces, but in your model, all faces are side faces. I cannot find a better way than what I suggested in the last message.

 

endface.jpg

Message 8 of 9
CadUser46
in reply to: xiaodong_liang

Hi Xiaodong.

 

Thanks for following up with the clarification.  I ended up trapping the error and will just live with the assumption.  I believe it will guess right the bulk of the time and where i got to it still saves the user a resonable chunk of time over manual methods.

 

 


Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.

---------------------------------------------------------------------------------------------------------------------------
Inventor 2010 Certified Professional
Currently using 2023 Pro
Message 9 of 9
vasanth.s.ext
in reply to: CadUser46

hi can you please help me to create breakout option using through rectangular shape.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report