Instead of drawing on the default top view. The code below will show how to draw on the front view Sub test() Dim pointUCS As Variant Dim circleObj As AcadCircle Dim centerPoint(0 To 2) As Double Set acadApp = GetObject(, "AutoCAD.Application") Set acadDoc = acadApp.ActiveDocument ' set the world ucs With acadDoc Set currUCS =… Continue reading Draw on UCS Front View
Category: 3D AutoCAD
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
AddSpline Method
This example will grab scanned data from an excel file and create a visual representation of the scan data in AutoCAD by drawing splines. I haved uploaded the excel file for viewing reference Scan Data_to_Autocad.xlsm Results: Drawn Splines Excel Scanned Data Option Explicit Public MTextObj As AcadMText Public ACLayout As AcadLayout Public acadApp As Object… Continue reading AddSpline Method
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