VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Can someone please explain the logic behind TranslateCoordinates?

1 REPLY 1
Reply
Message 1 of 2
Anonymous
221 Views, 1 Reply

Can someone please explain the logic behind TranslateCoordinates?

Hi

I have a model who's UCS is rotated about the Z axis.

This routine inserts a block & draws a line from the insert point of it.

Why does the insertpoint & Addline require the original Ipt but the Getpoint use the translated pointUCS1?

Have I got the UCS's round the right way within the TranslateCoordinates command?

I've never got my head around it & get the result by trial & error.

Hope you can help

Dave F.

Sub DrawBubble(HorV As String)
Dim IPt As Variant, LPt As Variant
Dim Ang As ACAD_ANGLE
Dim Pt2 As Variant
Dim pointUCS1 As Variant

IPt = ThisDrawing.Utility.GetPoint(, "Insert Point: ") ' insert point
Ang = dtr(360) - ThisDrawing.GetVariable("viewtwist")

ThisDrawing.ModelSpace.InsertBlock IPt, "C:\dwgs\Blocks\bh\grid2.dwg", 100, 100, 100, Ang
pointUCS1 = ThisDrawing.Utility.TranslateCoordinates(IPt, acWorld, acUCS, False)
Pt2 = ThisDrawing.Utility.GetPoint(pointUCS1, "End Point of Line: ")
ThisDrawing.ModelSpace.AddLine IPt, Pt2
End Sub
1 REPLY 1
Message 2 of 2
mkweaver01
in reply to: Anonymous

My take on this:
Anything involving user input will be based on the current ucs. Anything dealing directly with the database will use the world ucs.

Anyone else?

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost