How to bubble sub assembly parts, and working with Assembly in general , Vb.net
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
so ive just implemented sub assemblies into my project and their proving quite difficult, primary because alot of my functions were originally just listed for the part document object ive been able to sort alot of it but im still struggling how to get the representative draw curves on a drawing view of the assembly. ideally i want to include it in the block below. the component list comes from a function which gets all the components which have their origin within a transient box.
the component list dose end up giving me all the component occurrences in the box but its the component occurrence object from the sub assembly rather than the one in the top level.
For Each pOcc As ComponentOccurrence In ComponentList
Try
Dim drawcurves As DrawingCurvesEnumerator
drawcurves = ViewToBallon.DrawingCurves(pOcc)
drawcurves = ViewToBallon.DrawingCurves(pOcc)
Dim DrawCurve = drawcurves(1)
Dim midpnt As Point2d
midpnt = TryCast(DrawCurve.CenterPoint, Point2d)
If midpnt Is Nothing Then midpnt = TryCast(DrawCurve.MidPoint, Point2d)
If midpnt Is Nothing Then midpnt = GetiPoint2D(0, 0, _App)
Dim PointCollection As ObjectCollection = _App.TransientObjects.CreateObjectCollection
PointCollection.Add(midpnt)
PointCollection.Add(Sheet.CreateGeometryIntent(DrawCurve))
Dim Balloon = Sheet.Balloons.Add(PointCollection)
Dim BalloonVal = Split(pOcc.Name, ":").First
Balloon.BalloonValueSets(1).Value = BalloonVal
PlaceBalloonArrow(Balloon, pOcc, ViewToBallon)
BalloonList.Add(Balloon)
Catch ex As Exception
End Try
Next
another question i have is regarding a method to make a interface/object or some other method which automatically reduces to the correct component definition. and more generally how others deal with sub assemblies