Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Daan_M
in reply to: JelteDeJong

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

Daan_M_0-1597647481180.png

 

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)