Draw on UCS Front View

Instead of drawing on the default top view. The code below will show how to draw on the front view ' set the world ucs With acadDoc Set currUCS = .UserCoordinateSystems.Add(.GetVariable("UCSORG"), .Utility.TranslateCoordinates(.GetVariable("UCSXDIR"), acUCS, acWorld, 0), .Utility.TranslateCoordinates(.GetVariable("UCSYDIR"), acUCS, acWorld, 0), "OriginalUCS") End With 'Create a UCS and make it current origin(0) = 0: origin(1) = 0: … Continue reading Draw on UCS Front View

Add a Viewport and Show Front View

This will create a viewport in paper space and instead of the standard top view, the viewport will show as the front view center(0) = 5.4682: center(1) = 1.4055 dblviewdirection(0) = 0: dblviewdirection(1) = -1: dblviewdirection(0) = 0 Set pviewportObj = acadDoc.PaperSpace.AddPViewport(center, vpwidth, 2.2565) pviewportObj.direction = dblviewdirection pviewportObj.Layer = "viewport" pviewportObj.Display True acadDoc.MSpace = True … Continue reading Add a Viewport and Show Front View

TranslateCoordinates/TransformBy Methods

This example shows how to use TranslateCoordinates and TransformBy methods, which are very helpful when drawing 3D objects in autoCAD with VBA https://www.youtube.com/watch?v=j_07Jjd-pJk It first draws a closed polyline on the orginal UCS. The original UCS is given a name 'OriginalUCSj' so that we can activate the original UCS again. The polyline is then moved … Continue reading TranslateCoordinates/TransformBy Methods