- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to create a form in Visual Studio that allows user input to create a cylinder by adding the radius, x and y coordinates, and then extrude distance but after hitting the create button on the form i get the error 'System.MissingMemberException: 'Public member 'ComponentDefintion' on type 'PartDocument' not found.'
what could be the problem
Imports Inventor
Public Class shapecreaterform
Private Sub Btn_Create_Click(sender As Object, e As EventArgs) Handles Btn_Create.Click
Dim radius As Double = Txt_radius.Text
Dim xCoord As Double = Txt_X.Text
Dim yCoord As Double = Txt_Y.Text
Dim extrudeDistance As Double = Txt_ExtrudeDistance.Text
Dim oTG As TransientGeometry = g_inventorApplication.TransientGeometry
'Dim oDoc As PartDocument = g_inventorApplication.ActiveDocument
Dim oPartDoc As PartDocument = g_inventorApplication.Documents.Add(DocumentTypeEnum.kPartDocumentObject, g_inventorApplication.FileManager.GetTemplateFile(DocumentTypeEnum.kPartDocumentObject))
Dim oCompDef As PartComponentDefinition = oPartDoc.ComponentDefintion
Dim oSketch As PlanarSketch = oCompDef.Sketches.Add(oCompDef.WorkPlanes(2))
Dim centerPoint As Point2d = oTG.CreatePoint2d(xCoord, yCoord)
Dim circle As SketchCircle = oSketch.SketchCircles.AddByCenterRadius(centerPoint, radius)
Dim oProfile As Profile = oSketch.Profiles.AddForSolid
Dim oExtrudeDef As ExtrudeDefinition = oCompDef.Features.ExtrudeFeatures.CreateExtrudeDefinition(oProfile, PartFeatureOperationEnum.kJoinOperation)
oExtrudeDef.SetDistanceExtent(extrudeDistance, PartFeatureExtentDirectionEnum.kPositiveExtentDirection)
Dim oExtrude As ExtrudeFeature = oCompDef.Features.ExtrudeFeatures.Add(oExtrudeDef)
End Sub
End Class
Any help would be appreciated
thanks
Solved! Go to Solution.