Why won't this place my drawing views correctly?

Why won't this place my drawing views correctly?

tjg86f
Participant Participant
336 Views
4 Replies
Message 1 of 5

Why won't this place my drawing views correctly?

tjg86f
Participant
Participant
When I run this code it just places one view and its in the wrong place. Also, when I edit the style or scale of the view, It doesn't change anything

'define assembly As active document
Dim oDoc As AssemblyDocument oDoc = ThisApplication.ActiveDocument Try ThisApplication.Documents.Open _ (ThisDoc.PathAndFileName(True).Replace("iam", "idw")) Return 'exit rule Catch End Try oNewDrawing = ThisDoc.ChangeExtension(".idw") oTemplateFolder = ThisApplication.FileOptions.TemplatesPath oTemplate = oTemplateFolder & "Standard.idw" Dim oDrawingDoc As DrawingDocument oDrawingDoc = ThisApplication.Documents.Add (DocumentTypeEnum.kDrawingDocumentObject,, True) oDrawingDoc.Activate() Dim oSheet As Sheet oSheet = oDrawingDoc.Sheets.Item(1) Dim oPoint1 As Point2d oPoint = ThisApplication.TransientGeometry.CreatePoint2d(0, 0) Dim oPoint2 As Point2d oPoint = ThisApplication.TransientGeometry.CreatePoint2d(0, 0) Dim oPoint3 As Point2d oPoint = ThisApplication.TransientGeometry.CreatePoint2d(0, 0) ' place the base front view Dim oFrontview As DrawingView oFrontview = oSheet.DrawingViews.AddBaseView(oDoc, oPoint1, .5, ViewOrientationTypeEnum.kFrontViewOrientation, DrawingViewStyleEnum.kHiddenLineDrawingViewStyle) ' Creating projected views ' Dim oTopView As DrawingView oTopView = oSheet.DrawingViews.AddProjectedView(oFrontview, oPoint2, DrawingViewStyleEnum.kFromBaseDrawingViewStyle) Dim oIsoView As DrawingView oIsoView = oSheet.DrawingViews.AddProjectedView(oFrontview, oPoint3, DrawingViewStyleEnum.kFromBaseDrawingViewStyle) oDrawingDoc.SaveAs(oNewDrawing, False) MessageBox.Show("This new file saved as: " & oNewDrawing, "iLogic")
0 Likes
337 Views
4 Replies
Replies (4)
Message 2 of 5

jjstr8
Collaborator
Collaborator
Dim oPoint1 As Point2d
oPoint = ThisApplication.TransientGeometry.CreatePoint2d(0, 0)
Dim oPoint2 As Point2d
oPoint = ThisApplication.TransientGeometry.CreatePoint2d(0, 0)
Dim oPoint3 As Point2d
oPoint = ThisApplication.TransientGeometry.CreatePoint2d(0, 0)

These should be oPoint1, oPoint2, and oPoint3, not to mention they're all at the same coordinates.

0 Likes
Message 3 of 5

tjg86f
Participant
Participant
I fixed that but I'm still having the same issue
0 Likes
Message 4 of 5

tjg86f
Participant
Participant
another odd thing is its only placing a top view
0 Likes
Message 5 of 5

jjstr8
Collaborator
Collaborator

I don't seem to have any issues.  All I've changed is pointing to a valid template plus the fixes you stated that you've already addressed.

0 Likes