Help creating detail View using iLogic

Help creating detail View using iLogic

louisphilippe.dujardin
Contributor Contributor
282 Views
0 Replies
Message 1 of 1

Help creating detail View using iLogic

louisphilippe.dujardin
Contributor
Contributor

I have the same problem as @sohaib.as01 , referenced in this thread. (edited by moderator)
I am busy setting up a 2d plan with ilogic. I would like to make a detail view with an ilogic rule. My rule works but the detail view points to a random curve.I would like the detail view to point to the end of the curve that I have called "Wall_PP" in my 3D.
The detail view should point to a Point2d. But I can't convert my "Mur_PP" curve into a Point2d.
Could you tell me how to advance on my problem.
In my rule below, the curve "Item(6) should be replaced by the curve "Mur_PP".
I attach some example files. The rule is called detail view in the 2d plane.

Thanks in advance.

Louis-Philippe

 

Sub Main()
Dim oDrawing As DrawingDocument = ThisApplication.ActiveDocument	
Dim oSheet As Sheet = oDrawing.ActiveSheet
Dim oView As DrawingView = oSheet.DrawingViews.Item(1)
Dim oReferDoc As AssemblyDocument = oView.ReferencedDocumentDescriptor.ReferencedDocument
Dim oAssyDef As AssemblyComponentDefinition = oReferDoc.ComponentDefinition
Dim Occ As ComponentOccurrence
Dim oCurve As DrawingCurve
Dim oLine As DrawingCurve



Dim oTG As TransientGeometry = ThisApplication.TransientGeometry

		If oView.DrawingCurves(Occ).Count > 0 Then
			Dim oCollection As ObjectCollection = ThisApplication.TransientObjects.CreateObjectCollection
			Dim oCurves As DrawingCurvesEnumerator = oView.DrawingCurves(Occ)
				For Each oCurve In oCurves
					If oCurve.CurveType = kLineSegmentCurve Then
						Call oCollection.Add(oCurve)
					End If
				Next
				
				oLine = oCurves.Item(6)
			
		 End If

Dim Test_1 = ThisDrawing.Sheets.ItemByName("Test:1")
Dim VUE1 = Test_1.DrawingViews.ItemByName("VUE1")
Dim Mur_PP = VUE1.GetIntent("Maconnerie test:1", "Mur PP")



				Dim oMidpoint As Point2d
				Dim oStartpoint As Point2d
				Dim oEndpoint As Point2d
				Dim oMurPPPoint As Point2d

				Dim oGeometryIntent As GeometryIntent 
'				oMurPPPoint =oSheet.CreateGeometryIntent(Mur_PP, PointIntentEnum.kEndPointIntent) 
				oMidpoint = oLine.MidPoint
				oStartpoint = oLine.StartPoint
				oEndpoint = oLine.EndPoint
'				oGeometryIntent = oSheet.CreateGeometryIntent(oLine, PointIntentEnum.kEndPointIntent)
				
'		
			    ' Set a reference to the TransientGeometry object.

								
				Dim PmX As Double = oMidpoint.X
				Dim PmY As Double = oMidpoint.Y
				Dim PsX As Double = oStartpoint.X
				Dim PsY As Double = oStartpoint.Y
				Dim PeX As Double = oEndpoint.X
				Dim PeY As Double = oEndpoint.Y

				
			    ' Set a reference to the parent drawing view of the selected curve
			    Dim oDrawingView As DrawingView = oCurve.Parent

		


	oTG = ThisApplication.TransientGeometry

	'Dimension de la box de la DetailViewometry


	EscGPosA = oTG.CreatePoint2d(PeX-1, PeY+1)
	EscGPosB = oTG.CreatePoint2d(PeX+3, PeY-3)


	'Position de la vue de détail
	oPoint = oTG.CreatePoint2d(0, 0)  
	oPoint.X = oPoint.X + 5
	oPoint.Y = oPoint.Y + 5
    
    
    Dim oDetailView As DetailDrawingView
		

	oDetailView = oSheet.DrawingViews.AddDetailView(oDrawingView, oPoint,kFromBaseDrawingViewStyle, False, EscGPosA, EscGPosB, , oDrawingView.Scale * 2)


End Sub	Image sans titre.jpg

 

0 Likes
283 Views
0 Replies
Replies (0)