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: origin(2) = 0
    xAxis(0) = 1: xAxis(1) = 0: xAxis(2) = 0
    yAxis(0) = 0: yAxis(1) = 0: yAxis(2) = 1    'this will change coordinate system to a front view
    Set NewUCS = acadDoc.UserCoordinateSystems.Add(origin, xAxis, yAxis, "frontUCS")
    acadDoc.ActiveUCS = NewUCS
    'add code here of what you want to draw
    'Reset the UCS to its previous setting
    acadDoc.ActiveUCS = currUCS

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s