<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Inserting Block w/ Custom UCS in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/inserting-block-w-custom-ucs/m-p/2159885#M21595</link>
    <description>Sean I couldn't get that to always work. I find that the block rotation is tied into the Arbitary axis algorithym and follows the same rules as we discussed at http://www.theswamp.org/index.php?topic=18015.msg252785#msg252785.&lt;BR /&gt;
&lt;BR /&gt;
Blackbird the Rotation is very confusing as it doesn't necessarily use the x-axis of the current ucs as zero, it uses the angle that the world x-axis has on the ucs plane as zero. &lt;BR /&gt;
Without using matricies it's a bit difficult finding that angle.&lt;BR /&gt;
The least math ways are using the ucs &lt;BR /&gt;
1) as  I posted above (Sean the normal is reset to allow the matrix to rotate correctly)&lt;BR /&gt;
2) Make wcs active,insert the block at user assigned rotation then transform the block to the funky ucs (this is pretty much the same as 1)&lt;BR /&gt;
3) the hard way using the math posted at the swamp.</description>
    <pubDate>Sun, 20 Jan 2008 18:22:31 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2008-01-20T18:22:31Z</dc:date>
    <item>
      <title>Inserting Block w/ Custom UCS</title>
      <link>https://forums.autodesk.com/t5/vba-forum/inserting-block-w-custom-ucs/m-p/2159881#M21591</link>
      <description>Ugh!  Could someone please help.  I've read every posting on this issue and I'm still baffled.  I've got a routine where the user picks 2 points using ThisDrawing.Utility.GetPoint.  The code then inserts a block at the first point and calculates the angle between the 2 points as the blocks rotation.  No problem when working in WCS.  Everything goes haywire with a custom UCS though.&lt;BR /&gt;
&lt;BR /&gt;
Here's the code:&lt;BR /&gt;
&lt;BR /&gt;
    ATA_startPnt = ThisDrawing.Utility.GetPoint(, prompt1)&lt;BR /&gt;
    ATA_endPnt= ThisDrawing.Utility.GetPoint(ATA_startPnt, prompt2)  'This already screws up, as the startpnt isn't right&lt;BR /&gt;
&lt;BR /&gt;
     ATA_angle = ThisDrawing.Utility.AngleFromXAxis(ATA_startPnt, ATA_endPnt)&lt;BR /&gt;
&lt;BR /&gt;
     ATA_Object = ThisDrawing.ModelSpace.InsertBlock(ATA_startPnt, "ATA_Block", 1#, 1#, 1#, ATA_angle)&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
What do I have to do to make this work with any given UCS???  I've tried TranslateCoodinates.  I've tried TransformBy.  Why is this so bloody complicated?</description>
      <pubDate>Sat, 19 Jan 2008 06:31:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/inserting-block-w-custom-ucs/m-p/2159881#M21591</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-19T06:31:24Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting Block w/ Custom UCS</title>
      <link>https://forums.autodesk.com/t5/vba-forum/inserting-block-w-custom-ucs/m-p/2159882#M21592</link>
      <description>Try:&lt;BR /&gt;
&lt;BR /&gt;
With ThisDrawing&lt;BR /&gt;
ATA_startPnt = .Utility.GetPoint(, prompt1)&lt;BR /&gt;
ATA_startPntTran = .Utility.TranslateCoordinates(ATA_startPnt, acWorld, acUCS, 0)&lt;BR /&gt;
ATA_endPnt = .Utility.GetPoint(ATA_startPntTran, prompt2)&lt;BR /&gt;
ATA_endPntTran = .Utility.TranslateCoordinates(ATA_endPnt, acWorld, acUCS, 0)&lt;BR /&gt;
ATA_angle = .Utility.AngleFromXAxis(ATA_startPntTran, ATA_endPntTran)&lt;BR /&gt;
&lt;BR /&gt;
Set ATA_Object = .ModelSpace.InsertBlock(ATA_startPnt, "ATA_Block", 1#, 1#, 1#, ATA_angle)&lt;BR /&gt;
End With</description>
      <pubDate>Sat, 19 Jan 2008 12:20:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/inserting-block-w-custom-ucs/m-p/2159882#M21592</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-19T12:20:57Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting Block w/ Custom UCS</title>
      <link>https://forums.autodesk.com/t5/vba-forum/inserting-block-w-custom-ucs/m-p/2159883#M21593</link>
      <description>The angle is related to the world xaxis transformed to the current ucs rather than directly from the current ucs,&lt;BR /&gt;
below is one way&lt;BR /&gt;
&lt;BR /&gt;
[code]&lt;BR /&gt;
Sub InB()&lt;BR /&gt;
&lt;BR /&gt;
    Dim Pt, rPt, Ang As Double, Ang2 As Double&lt;BR /&gt;
    Dim B As AcadBlockReference&lt;BR /&gt;
    With ThisDrawing.Utility&lt;BR /&gt;
        Pt = .GetPoint(, "Base")&lt;BR /&gt;
        rPt = .GetPoint(.TranslateCoordinates(Pt, acWorld, acUCS, False), "Angle")&lt;BR /&gt;
        Ang = .AngleFromXAxis(Pt, rPt)&lt;BR /&gt;
        Ang2 = .AngleFromXAxis(.TranslateCoordinates(Pt, acWorld, acUCS, False), _&lt;BR /&gt;
        .TranslateCoordinates(rPt, acWorld, acUCS, False))&lt;BR /&gt;
&lt;BR /&gt;
        Set B = InsertBlockref(ThisDrawing.ModelSpace, Pt, "A", 1, Ang2)&lt;BR /&gt;
     &lt;BR /&gt;
    End With&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Function InsertBlockref(Space As AcadBlock, insPt As Variant, _&lt;BR /&gt;
        sName As String, Optional Sc As Double = 1, Optional Rot As Double = 0, _&lt;BR /&gt;
        Optional P As Variant) As AcadBlockReference&lt;BR /&gt;
&lt;BR /&gt;
    Dim oBref As AcadBlockReference&lt;BR /&gt;
    Dim Zero(2) As Double&lt;BR /&gt;
    Dim N(2) As Double, oUcs As AcadUCS&lt;BR /&gt;
    Dim Att&lt;BR /&gt;
    Dim Origin&lt;BR /&gt;
    Dim Xaxis, Yaxis&lt;BR /&gt;
    Dim strNm As String, sUcs As String&lt;BR /&gt;
    &lt;BR /&gt;
    Set oBref = Space.InsertBlock(Zero, sName, Sc, Sc, Sc, Rot)&lt;BR /&gt;
    If ThisDrawing.GetVariable("Worlducs") = 1 Then GoTo skip&lt;BR /&gt;
    &lt;BR /&gt;
    N(2) = 1&lt;BR /&gt;
    oBref.Normal = N&lt;BR /&gt;
    &lt;BR /&gt;
    With ThisDrawing&lt;BR /&gt;
        Origin = .GetVariable("UCSORG")&lt;BR /&gt;
        Xaxis = .GetVariable("UCSXDIR")&lt;BR /&gt;
        Yaxis = .GetVariable("UCSYDIR")&lt;BR /&gt;
        strNm = "Active"&lt;BR /&gt;
    End With&lt;BR /&gt;
    Set oUcs = ThisDrawing.UserCoordinateSystems.Add(Zero, Xaxis, Yaxis, strNm)&lt;BR /&gt;
    'Changing the origin later stops the error message&lt;BR /&gt;
    '-2145320930   UCS X axis and Y axis are not perpendicular&lt;BR /&gt;
    oUcs.Origin = Origin&lt;BR /&gt;
    ThisDrawing.ActiveUCS = oUcs&lt;BR /&gt;
    &lt;BR /&gt;
    If oBref.HasAttributes Then&lt;BR /&gt;
        For Each Att In oBref.GetAttributes&lt;BR /&gt;
            Att.Normal = N&lt;BR /&gt;
        Next Att&lt;BR /&gt;
    End If&lt;BR /&gt;
    &lt;BR /&gt;
    oBref.TransformBy oUcs.GetUCSMatrix&lt;BR /&gt;
skip:&lt;BR /&gt;
    oBref.InsertionPoint = insPt&lt;BR /&gt;
    Set InsertBlockref = oBref&lt;BR /&gt;
    &lt;BR /&gt;
End Function&lt;BR /&gt;
[/code]</description>
      <pubDate>Sun, 20 Jan 2008 04:28:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/inserting-block-w-custom-ucs/m-p/2159883#M21593</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-20T04:28:16Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting Block w/ Custom UCS</title>
      <link>https://forums.autodesk.com/t5/vba-forum/inserting-block-w-custom-ucs/m-p/2159884#M21594</link>
      <description>Bryco,&lt;BR /&gt;
&lt;BR /&gt;
It appears that a block insertion respects the “Z” value of the current UCS i.e., the Block Reference’s normal will align correctly to the UCS (similar to the AddCircle method) without the need of transformation.  &lt;BR /&gt;
&lt;BR /&gt;
I find that:&lt;BR /&gt;
&lt;BR /&gt;
Sub InB()&lt;BR /&gt;
    Dim Pt, rPt, Ang As Double, Ang2 As Double&lt;BR /&gt;
    Dim B As AcadBlockReference&lt;BR /&gt;
    With ThisDrawing.Utility&lt;BR /&gt;
        Pt = .GetPoint(, "Base")&lt;BR /&gt;
        rPt = .GetPoint(.TranslateCoordinates(Pt, acWorld, acUCS, False), "Angle")&lt;BR /&gt;
        Ang = .AngleFromXAxis(Pt, rPt)&lt;BR /&gt;
        Ang2 = .AngleFromXAxis(.TranslateCoordinates(Pt, acWorld, acUCS, False), _&lt;BR /&gt;
        .TranslateCoordinates(rPt, acWorld, acUCS, False))&lt;BR /&gt;
 &lt;BR /&gt;
        Set B = ThisDrawing.ModelSpace.InsertBlock(Pt, "A", 1, 1, 1, Ang2)&lt;BR /&gt;
    End With&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
. . . .works without the InsertBlockref function.  Is there something about the methodology that I’m missing?</description>
      <pubDate>Sun, 20 Jan 2008 09:34:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/inserting-block-w-custom-ucs/m-p/2159884#M21594</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-20T09:34:32Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting Block w/ Custom UCS</title>
      <link>https://forums.autodesk.com/t5/vba-forum/inserting-block-w-custom-ucs/m-p/2159885#M21595</link>
      <description>Sean I couldn't get that to always work. I find that the block rotation is tied into the Arbitary axis algorithym and follows the same rules as we discussed at http://www.theswamp.org/index.php?topic=18015.msg252785#msg252785.&lt;BR /&gt;
&lt;BR /&gt;
Blackbird the Rotation is very confusing as it doesn't necessarily use the x-axis of the current ucs as zero, it uses the angle that the world x-axis has on the ucs plane as zero. &lt;BR /&gt;
Without using matricies it's a bit difficult finding that angle.&lt;BR /&gt;
The least math ways are using the ucs &lt;BR /&gt;
1) as  I posted above (Sean the normal is reset to allow the matrix to rotate correctly)&lt;BR /&gt;
2) Make wcs active,insert the block at user assigned rotation then transform the block to the funky ucs (this is pretty much the same as 1)&lt;BR /&gt;
3) the hard way using the math posted at the swamp.</description>
      <pubDate>Sun, 20 Jan 2008 18:22:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/inserting-block-w-custom-ucs/m-p/2159885#M21595</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-20T18:22:31Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting Block w/ Custom UCS</title>
      <link>https://forums.autodesk.com/t5/vba-forum/inserting-block-w-custom-ucs/m-p/2159886#M21596</link>
      <description>Ah, yes.  I mistakenly thought that with both a Normal (in this case the Z of the UCS) and a designated X (via the two pick points) that there would be no ambiguity for placement.  I forgot your demonstration of the arbitrary nature of incoming block references.&lt;BR /&gt;
&lt;BR /&gt;
As an OCS issue, another method of incorporating the Arbitrary Axis Algorithm is to have AutoCAD make the necessary calcs via TranslateCoordinate method:&lt;BR /&gt;
&lt;BR /&gt;
Sub InsertViaUCS()&lt;BR /&gt;
Dim ATA_startPnt As Variant&lt;BR /&gt;
Dim ATA_endPnt As Variant&lt;BR /&gt;
Dim ATA_startPntTran As Variant&lt;BR /&gt;
Dim ATA_endPntTran As Variant&lt;BR /&gt;
Dim ATA_angle As Double&lt;BR /&gt;
Dim ATA_Object As AcadBlockReference&lt;BR /&gt;
Dim dblZ(2) As Double&lt;BR /&gt;
Dim varZ As Variant&lt;BR /&gt;
   dblZ(2) = 1#&lt;BR /&gt;
   With ThisDrawing&lt;BR /&gt;
      varZ = .Utility.TranslateCoordinates(dblZ, acUCS, acWorld, 0)&lt;BR /&gt;
      ATA_startPnt = .Utility.GetPoint(, "Origin Point: ")&lt;BR /&gt;
      ATA_startPntTran = .Utility.TranslateCoordinates(ATA_startPnt, acWorld, acUCS, 0)&lt;BR /&gt;
      ATA_endPnt = .Utility.GetPoint(ATA_startPntTran, "Direction Vector: ")&lt;BR /&gt;
      ATA_startPntTran = .Utility.TranslateCoordinates(ATA_startPnt, acWorld, acOCS, 0, varZ)&lt;BR /&gt;
      ATA_endPntTran = .Utility.TranslateCoordinates(ATA_endPnt, acWorld, acOCS, 0, varZ)&lt;BR /&gt;
      ATA_angle = .Utility.AngleFromXAxis(ATA_startPntTran, ATA_endPntTran)&lt;BR /&gt;
      Set ATA_Object = .ModelSpace.InsertBlock(ATA_startPnt, "A", 1#, 1#, 1#, ATA_angle)&lt;BR /&gt;
   End With&lt;BR /&gt;
End Sub</description>
      <pubDate>Sun, 20 Jan 2008 23:17:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/inserting-block-w-custom-ucs/m-p/2159886#M21596</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-20T23:17:41Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting Block w/ Custom UCS</title>
      <link>https://forums.autodesk.com/t5/vba-forum/inserting-block-w-custom-ucs/m-p/2159887#M21597</link>
      <description>Excellent!!  That worked SEANT.  Props.&lt;BR /&gt;
&lt;BR /&gt;
Not sure exactly how, but that varZ at the end obviously did the trick.  Amazing how the simplest things in lisp can get so complicated in VBA.</description>
      <pubDate>Mon, 21 Jan 2008 00:14:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/inserting-block-w-custom-ucs/m-p/2159887#M21597</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-21T00:14:32Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting Block w/ Custom UCS</title>
      <link>https://forums.autodesk.com/t5/vba-forum/inserting-block-w-custom-ucs/m-p/2159888#M21598</link>
      <description>'Amazing how the simplest things in lisp can get so complicated in VBA.'&lt;BR /&gt;
&lt;BR /&gt;
VBA is "special" that way. &lt;BR /&gt;
&lt;BR /&gt;
This latest method seems to works with all the cases that gave my earlier suggestion problems, but I would keep an eye on it for some time - to be safe.</description>
      <pubDate>Mon, 21 Jan 2008 00:42:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/inserting-block-w-custom-ucs/m-p/2159888#M21598</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-21T00:42:46Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting Block w/ Custom UCS</title>
      <link>https://forums.autodesk.com/t5/vba-forum/inserting-block-w-custom-ucs/m-p/2159889#M21599</link>
      <description>Sean,it's a great idea but it doesn't always work, for me, the easiest way to get a funky ucs is to draw a rectangle then use rotate3d picking the lower left corner and the midpoint of the opposite side then type 33 or something.&lt;BR /&gt;
Anyway please check it again.</description>
      <pubDate>Mon, 21 Jan 2008 04:11:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/inserting-block-w-custom-ucs/m-p/2159889#M21599</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-21T04:11:48Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting Block w/ Custom UCS</title>
      <link>https://forums.autodesk.com/t5/vba-forum/inserting-block-w-custom-ucs/m-p/2159890#M21600</link>
      <description>I can't find a UCS that breaks the routine.  I've tried some Funky UCSs, your method,  Orbit-UCS-View method, as well as UCSs with Zs howering just inside and outside the 1/64th zone.  &lt;BR /&gt;
&lt;BR /&gt;
Could you upload the DWG with the problem UCS.  There are too many possibilities to hunt down randomly.&lt;BR /&gt;
&lt;BR /&gt;
Theoretically, TranslateCoordinates with OCS is hooking into the same code AutoCAD uses to produce the block insertion anomaly in the first place.  That translate call should negate the issue.

Message was edited by: SEANT</description>
      <pubDate>Mon, 21 Jan 2008 09:15:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/inserting-block-w-custom-ucs/m-p/2159890#M21600</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-21T09:15:15Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting Block w/ Custom UCS</title>
      <link>https://forums.autodesk.com/t5/vba-forum/inserting-block-w-custom-ucs/m-p/2159891#M21601</link>
      <description>Click points on the line and the block doesn't align to it</description>
      <pubDate>Mon, 21 Jan 2008 16:03:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/inserting-block-w-custom-ucs/m-p/2159891#M21601</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-21T16:03:43Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting Block w/ Custom UCS</title>
      <link>https://forums.autodesk.com/t5/vba-forum/inserting-block-w-custom-ucs/m-p/2159892#M21602</link>
      <description>This is getting interesting.  A small code change was needed to work with that UCS.  VarZ has to be translated as a displacement vector instead of a point.  Apparently that does not become an issue until the UCS origin is sufficiently far from the WCS origin..&lt;BR /&gt;
&lt;BR /&gt;
Sub InsertViaUCS()&lt;BR /&gt;
Dim ATA_startPnt As Variant&lt;BR /&gt;
Dim ATA_endPnt As Variant&lt;BR /&gt;
Dim ATA_startPntTran As Variant&lt;BR /&gt;
Dim ATA_endPntTran As Variant&lt;BR /&gt;
Dim ATA_angle As Double&lt;BR /&gt;
Dim ATA_Object As AcadBlockReference&lt;BR /&gt;
Dim dblZ(2) As Double&lt;BR /&gt;
Dim varZ As Variant&lt;BR /&gt;
dblZ(2) = 1#&lt;BR /&gt;
With ThisDrawing&lt;BR /&gt;
varZ = .Utility.TranslateCoordinates(dblZ, acUCS, acWorld, 1)&lt;BR /&gt;
ATA_startPnt = .Utility.GetPoint(, "Origin Point: ")&lt;BR /&gt;
ATA_startPntTran = .Utility.TranslateCoordinates(ATA_startPnt, acWorld, acUCS, 0)&lt;BR /&gt;
ATA_endPnt = .Utility.GetPoint(ATA_startPntTran, "Direction Vector: ")&lt;BR /&gt;
ATA_startPntTran = .Utility.TranslateCoordinates(ATA_startPnt, acWorld, acOCS, 0, varZ)&lt;BR /&gt;
ATA_endPntTran = .Utility.TranslateCoordinates(ATA_endPnt, acWorld, acOCS, 0, varZ)&lt;BR /&gt;
ATA_angle = .Utility.AngleFromXAxis(ATA_startPntTran, ATA_endPntTran)&lt;BR /&gt;
Set ATA_Object = .ModelSpace.InsertBlock(ATA_startPnt, "A", 1#, 1#, 1#, ATA_angle)&lt;BR /&gt;
End With&lt;BR /&gt;
End Sub</description>
      <pubDate>Mon, 21 Jan 2008 16:59:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/inserting-block-w-custom-ucs/m-p/2159892#M21602</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-21T16:59:30Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting Block w/ Custom UCS</title>
      <link>https://forums.autodesk.com/t5/vba-forum/inserting-block-w-custom-ucs/m-p/2159893#M21603</link>
      <description>Additional comment:  Regardless of any final outcome, I’m not suggesting anyone substitute code that has endured numerous hours of use in the trenches.  This is more an endeavor of intellectual curiosity, to understand AutoCAD’s underpinnings, to perhaps elevate my Cargo Cultist status.&lt;BR /&gt;
&lt;BR /&gt;
Also, watch word wrap in the code posted above

Message was edited by: SEANT</description>
      <pubDate>Mon, 21 Jan 2008 17:00:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/inserting-block-w-custom-ucs/m-p/2159893#M21603</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-21T17:00:23Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting Block w/ Custom UCS</title>
      <link>https://forums.autodesk.com/t5/vba-forum/inserting-block-w-custom-ucs/m-p/2159894#M21604</link>
      <description>Agreed, it seems like a great way to do it. I never thought of doing it that way as I've mostly used the ocs for plines. There is probably more math doing it this way but it's more understandable so a good way.&lt;BR /&gt;
&lt;BR /&gt;
Blackbird was asking you why the addition of tne normal in the translation helped by the way.</description>
      <pubDate>Mon, 21 Jan 2008 17:12:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/inserting-block-w-custom-ucs/m-p/2159894#M21604</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-21T17:12:38Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting Block w/ Custom UCS</title>
      <link>https://forums.autodesk.com/t5/vba-forum/inserting-block-w-custom-ucs/m-p/2159895#M21605</link>
      <description>With regard to the varZ at the end of the TranslateCoordinate, it is a rather convoluted situation, at least as I see it, and I’m assuming I’m not seeing all of it.&lt;BR /&gt;
&lt;BR /&gt;
Autocad stores many of its planar graphical elements (LWPlines in particular) in a compressed state, with  XY coordinates, Elevation, and a Object Coordinate System (OCS).  The OCS is efficiently described via a simple “Normal” (Z axis direction).  However, a simple normal does not give enough information to determine an X and Y axis.   The OCS does, however, obey some preset rules (not easily discernable) that allow a predictable XY.  &lt;BR /&gt;
&lt;BR /&gt;
The rules are designed to compensate for some deficiencies in Binary math (speculation) and as a result, produce a 90 degree twist at various Normal/WCS Z relationsips.  It is the reason our inserts act as if they have a mind of their own.&lt;BR /&gt;
&lt;BR /&gt;
Conceivably, the TranslateCoordinate Method can perform the calcs for us given the appropriate Normal.  That is what the “varZ” is doing.  Or so the theory goes.&lt;BR /&gt;
&lt;BR /&gt;
References:&lt;BR /&gt;
&lt;BR /&gt;
Autocad Developer Documentation/DXF Reference/Advanced DXF Issues/ Arbitrary Axis Algorithm&lt;BR /&gt;
&lt;BR /&gt;
http://www.mines.edu/~gmurray/ArbitraryAxisRotation/ArbitraryAxisRotation.pdf

Message was edited by: SEANT&lt;BR /&gt;
Clarification</description>
      <pubDate>Mon, 21 Jan 2008 17:43:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/inserting-block-w-custom-ucs/m-p/2159895#M21605</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-21T17:43:45Z</dc:date>
    </item>
  </channel>
</rss>

