progeCAD support, tips and troubleshooting forum. progeCAD works very similar to some versions of AutoCAD. Moderated.

Moderators: caddit, Moderators

#2162 by thomasullmann
Sun Jun 08, 2014 10:25 am
in my drawing i have the ucs's top, left, right and world.

to Change the ucs to world i use the commandsend:
MyDok.SendCommand ("_UCS" & vbCr & "World" & vbCr)

is there an other posibility to Change the ucs, something like this:


thank you for your help.

#2164 by caddit
Mon Jun 16, 2014 8:35 am
Dear thomasullmann,

Not exactly, as you may be discovering, such a VBA method doesn't exist. You would have to define it first like follows:

Code: Select all  'active World UCS in the current document
  Sub activeWorldUCS()
    Dim ucsObj As UserCoordSystem
    Dim newOrg As New Point
    Dim NewXAxis As New Vector
    Dim NewYAxis As New Vector
    newOrg.x = 0
    newOrg.y = 0
    newOrg.z = 0
    NewXAxis.x = 1
    NewXAxis.y = 0
    NewXAxis.z = 0
    NewYAxis.x = 0
    NewYAxis.y = 1
    NewYAxis.z = 0
    Set ucsObj = ActiveDocument.UserCoordinateSystems.Add(newOrg, NewXAxis, NewYAxis, "World")
    ActiveDocument.ActiveUCS = ucsObj
  End Sub