Drawing automation sketchpoint into an intent

Drawing automation sketchpoint into an intent

patrice.vallet
Contributor Contributor
230 Views
0 Replies
Message 1 of 1

Drawing automation sketchpoint into an intent

patrice.vallet
Contributor
Contributor

Hello,

 

I'm working on a drawing automation, but i'm struggling on a point.

 

I need to transform a sketchpoint into an Intent to after used it to put drawing dimension.

I'm able to find the sketchpoint with attribut, but I don't know how to transform this sketchpoint into an Intent.

I'm using inventor 2019.

 

Can you help me ?

 

This is an extract of my general code used in an external rules :

Function FindSketchPoint(osheet As Inventor.Sheet, _
	oView As Inventor.DrawingView, _
	ByVal CompOccName As String, _
	ByVal AttributeName As String, _
	oPartType As Inventor.DocumentTypeEnum) As Inventor.GeometryIntent

	Dim oCol As Inventor.ObjectCollection
	Dim oCocc As Inventor.ComponentOccurrence
	Dim oPoint As Inventor.SketchPoint
	Dim oPointProxy As Inventor.SketchPointProxy
	Dim oDoc As Inventor.Document

	oDoc = ThisApplication.Documents.Open(oView.ReferencedDocumentDescriptor.FullDocumentName, False)

	If CompOccName = "" Then
		oCol = oDoc.AttributeManager.FindObjects("*", "*", AttributeName)
		oPoint = oCol.Item(1)
	Else
		Select Case oPartType
			Case Inventor.DocumentTypeEnum.kAssemblyDocumentObject
				Call processAllSubOcc1(oView, CompOccName, oCocc)
				oDoc = ThisApplication.Documents.Open(oCocc.ReferencedDocumentDescriptor.FullDocumentName, False)
				oCol = oDoc.AttributeManager.FindObjects("*", "*", AttributeName)
				oPoint = oCol(1)
				oCocc.CreateGeometryProxy(oPoint, oPointProxy)
				Dim Pt2d As Point2d
				Pt2d = oPointProxy.Geometry
				Logger.Debug("X : " & Pt2d.X & ", Y : "& Pt2d.Y)
			Case Inventor.DocumentTypeEnum.kPartDocumentObject
				oCol = oDoc.AttributeManager.FindObjects("*", "*", AttributeName)
				oPoint = oCol(1)
		End Select
	End If

	Dim oIntent As GeometryIntent
	oIntent = osheet.CreateGeometryIntent(oPointProxy)

	FindSketchPoint = oIntent

End Function

 

0 Likes
231 Views
0 Replies
Replies (0)