- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
As the title suggests, im trying to make iLogic create a Detail View, like so (done manually with UI);
I have the following code:
Dim oPointDetail As Point2d
oPointDetail = oView2.Center
oPointDetail.X = oPointDetail.X - 0.5 * oView2.Width
Dim oCurveSeg As DrawingCurveSegment
oCurveSeg = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingCurveSegmentFilter, "Pick")
Dim oCenterPoint As Point2d
oCenterPoint = oCurveSeg.StartPoint
Dim oDetailView As DetailDrawingView
oDetailView = oSheet.DrawingViews.AddDetailView(oView2, oPointDetail, kFromBaseDrawingViewStyle, True, oCentrePoint, 1, , oView2.Scale * 3, True, "Detail A")
i ran into two problems:
1. i get an error with the cause 'wrong paramater', after looking at it i found out why;
The property 'StartPoint' returns nothing when the selected DrawingCurveSegment is circular (which mine is).
How can i work around this?
2. I use a manual picker to select a DrawingCurveSegment right now, which is fine for testing, but i want this automated. The segment i need a detail of is always the same, so the goal is to define that segment in my iLogic and assign it to oCurveseg
oCurveSeg = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingCurveSegmentFilter, "Pick")
Thanks in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Have you seen this post? It shows how to create a drawing from scratch inclusive creating a detail view.
Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Blog: hjalte.nl - github.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Thanks I've managed to place a detailview in the position and scale i want;
Dim DCP As Point2d
DCP = oV2Cm4.Position
Dim DPPV As Double = (oSheet.Height - 15)
Dim DPPH As Double = (oSheet.Width - 25)
Dim DPP As Point2d
DPP = ThisApplication.TransientGeometry.CreatePoint2d(DPPH, DPPV)
Dim oPointDetail As Point2d
oPointDetail = oView2.Center
oPointDetail.X = oPointDetail.X - 0.5 * oView2.Width
Dim oDetailView As DetailDrawingView
oDetailView = oSheet.DrawingViews.AddDetailView(oView2, DPP, kFromBaseDrawingViewStyle, True, DCP, 0.5, , oView2.Scale * 2, True, "A")
I'm stuck at placing the annotations on the detail view. I'm not sure how i should create the centermarks, for centermarks on my regular views i use;
Dim oCMs As Centermarks = oSheet.Centermarks
For Each oDView As DrawingView In oSheet.DrawingViews
'----- Assign WPs to CMs for View1 -----
If oDView.Name.Contains("View1") Then
oView1 = oDView
oV1Cm1 = oCMs.AddByWorkFeature(oWP1, oView1) 'KFI5
oV1Cm2 = oCMs.AddByWorkFeature(oWP5, oView1) 'KFI6
According to the Inventor api object model a detail drawingview is different from a drawingview
i tried doing this but without succes;
Dim oScm1, oScm2 As Centermark
oScm1 = oCMs.AddByWorkFeature(oWP23, oDetailView)
oScm2 = oCMs.AddByWorkFeature(oWP24, oDetailView)
error;
System.ArgumentException: The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))
at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
at Inventor.Centermarks.AddByWorkFeature(Object WorkFeature, DrawingView DrawingView, Object CentermarkStyle, Object Layer)
at ThisRule.Main()
at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)
at iLogic.RuleEvalContainer.ExecRuleEval(String execRule)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
For anyone trying to recreate this now, there is an error in line 12 that was preventing this code from working for me: "centre" should be "center"