Message 1 of 7
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Im sure im overlooking something small but I am trying to get a part file created before I edit it with passed variables. The issue Im having is the line below is giving me the error "Error BC30469 Reference to a non-shared member requires an object reference. "
Dim oDoc As PartDocument = Documents.Add(DocumentTypeEnum.kPartDocumentObject, oTemplatesPath & "standard.ipt", False)
Below is this full portion of code:
Public Sub CreateStandardPart(x_length As Double, y_length As Double, z_length As Double, loc As String, oPath As String)
'Create a new part with your desired part template
Dim oProjectMgr As DesignProjectManager
Dim oProject As DesignProject
oProject = oProjectMgr.ActiveDesignProject
Dim oTemplatesPath As String
oTemplatesPath = oProject.TemplatesPath
Dim oDoc As PartDocument = Documents.Add(DocumentTypeEnum.kPartDocumentObject, oTemplatesPath & "standard.ipt", False)
oDoc.OpenFile()
oDoc.SaveAs(loc & oPath, True)
oDoc.Close(False)
End Sub
Let me know if you have any ideas. Thanks
Solved! Go to Solution.