Hi Daan_M,
The code you placed works indeed. I have tested it in another assembly.
But this is the code I have in my assy and there it does not work for some reason...I am copying only the first part. The rest of the code places views on the sheet 1 which is not that interesting here.
Error is general....parameter is not correct...
Dim oDoc As Document
oDoc = ThisApplication.ActiveDocument
oExt = Right(oDoc.FullDocumentName, 3) 'get file extension
oPath = ThisDoc.Path
Dim oDrawingDocName As String = User_parameter_1
Try 'to open the drawing
ThisApplication.Documents.Open _
(ThisDoc.PathAndFileName(True).Replace(oExt, "idw"))
Return 'exit rule
Catch
End Try
Dim oDrawingDoc As DrawingDocument
oDrawingDoc = ThisApplication.Documents.Add(DocumentTypeEnum.kDrawingDocumentObject, "C:\Inventor\template.idw", True)
oDrawingDoc.SaveAs(oPath & "\" & oDrawingDocName, True)
oDrawingDoc.Activate()
Dim oSheet As Sheet
oSheet = oDrawingDoc.Sheets.Item(1)
Dim oPoint1 As Point2d = ThisApplication.TransientGeometry.CreatePoint2d(20, 20)
...