<?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: Selecting and Moving grips on dynamic blocks? in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/selecting-and-moving-grips-on-dynamic-blocks/m-p/3739902#M51986</link>
    <description>&lt;P&gt;Anybody out there?&lt;/P&gt;</description>
    <pubDate>Wed, 19 Dec 2012 15:11:12 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2012-12-19T15:11:12Z</dc:date>
    <item>
      <title>Selecting and Moving grips on dynamic blocks?</title>
      <link>https://forums.autodesk.com/t5/net-forum/selecting-and-moving-grips-on-dynamic-blocks/m-p/3738311#M51981</link>
      <description>&lt;P&gt;I apologize if this has been answered before, I took the time to search and was unable to find anything that seemed relevant. I have also had trouble figuring out the documentation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to select a specific grip within a dynamic block and then update its position?&lt;/P&gt;&lt;P&gt;Would some one be kind enough to share an example, or point me in the right direction?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 17 Dec 2012 15:33:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/selecting-and-moving-grips-on-dynamic-blocks/m-p/3738311#M51981</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-12-17T15:33:48Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting and Moving grips on dynamic blocks?</title>
      <link>https://forums.autodesk.com/t5/net-forum/selecting-and-moving-grips-on-dynamic-blocks/m-p/3738453#M51983</link>
      <description>&lt;P&gt;This is what I am trying currently.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;public void MoveGrip(Point3d gripPoint, Vector3d offset)
        {
            Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
            Database db = doc.Database;
            Transaction tr = db.TransactionManager.StartTransaction();
            using (tr)
            {
                BlockReference br = null;
                Entity ent = (Entity)tr.GetObject(_oBlockRefId, OpenMode.ForWrite);
                br = ent as BlockReference;
                if(br != null)
                {
                    GripDataCollection grips = new GripDataCollection();
                    GripDataCollection updateGrip = new GripDataCollection();
                    double curViewUnitSize = 0;
                    int gripSize = 0;
                    Vector3d curViewDir = doc.Editor.GetCurrentView().ViewDirection;
                    GetGripPointsFlags bitFlags = GetGripPointsFlags.GripPointsOnly;
                    br.GetGripPoints(grips, curViewUnitSize, gripSize, curViewDir, bitFlags);
                    foreach (GripData grip in grips)
                    {
                        if (grip.GripPoint == gripPoint)
                        {
                            updateGrip.Add(grip);
                        }
                    }
                    br.MoveGripPointsAt(updateGrip, offset, MoveGripPointsFlags.Polar);
                }
            }
        }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Stepping through it, it looks like I do get a collection of points, and one does match with the position passed in.&lt;/P&gt;&lt;P&gt;What does not work is "MoveGripPointsAt", I have tried using the different enums available. No luck so far.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Dec 2012 18:11:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/selecting-and-moving-grips-on-dynamic-blocks/m-p/3738453#M51983</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-12-17T18:11:57Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting and Moving grips on dynamic blocks?</title>
      <link>https://forums.autodesk.com/t5/net-forum/selecting-and-moving-grips-on-dynamic-blocks/m-p/3738588#M51984</link>
      <description>&lt;P&gt;Just to clarify what I am trying to accomplish,&lt;/P&gt;&lt;P&gt;I have pipes that need to be streched and rotated to have their ends pined to a specified point.&lt;/P&gt;&lt;P&gt;I can manually select the polar grip and pin it to the point.&lt;/P&gt;&lt;P&gt;What I want is to avoid having to calculate the angles and strech values.&lt;/P&gt;&lt;P&gt;Some of the dynamic blocks have different property names, some rotations are offset, and some blocks are inverted.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please any suggestions would be much appreciated.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Dec 2012 20:57:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/selecting-and-moving-grips-on-dynamic-blocks/m-p/3738588#M51984</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-12-17T20:57:50Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting and Moving grips on dynamic blocks?</title>
      <link>https://forums.autodesk.com/t5/net-forum/selecting-and-moving-grips-on-dynamic-blocks/m-p/3739194#M51985</link>
      <description>&lt;P&gt;Im being told its not possible to get a grip, and update its postition? I find it hard to believe.&lt;/P&gt;&lt;P&gt;Would really appreciate some some input.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Trying to find any information on GetGripData, and MoveGripPointsAt has been a huge pain.&lt;/P&gt;&lt;P&gt;I feel like It should not be this difficult.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This looks like its the only documentation out there,&amp;nbsp;&lt;A href="http://docs.autodesk.com/ACD/2010/ENU/AutoCAD%20.NET%20Developer's%20Guide/index.html" target="_blank"&gt;http://docs.autodesk.com/ACD/2010/ENU/AutoCAD%20.NET%20Developer's%20Guide/index.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Dec 2012 17:15:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/selecting-and-moving-grips-on-dynamic-blocks/m-p/3739194#M51985</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-12-18T17:15:59Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting and Moving grips on dynamic blocks?</title>
      <link>https://forums.autodesk.com/t5/net-forum/selecting-and-moving-grips-on-dynamic-blocks/m-p/3739902#M51986</link>
      <description>&lt;P&gt;Anybody out there?&lt;/P&gt;</description>
      <pubDate>Wed, 19 Dec 2012 15:11:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/selecting-and-moving-grips-on-dynamic-blocks/m-p/3739902#M51986</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-12-19T15:11:12Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting and Moving grips on dynamic blocks?</title>
      <link>https://forums.autodesk.com/t5/net-forum/selecting-and-moving-grips-on-dynamic-blocks/m-p/3741175#M51987</link>
      <description>&lt;P&gt;bump&lt;/P&gt;</description>
      <pubDate>Thu, 20 Dec 2012 21:13:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/selecting-and-moving-grips-on-dynamic-blocks/m-p/3741175#M51987</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-12-20T21:13:17Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting and Moving grips on dynamic blocks?</title>
      <link>https://forums.autodesk.com/t5/net-forum/selecting-and-moving-grips-on-dynamic-blocks/m-p/3741190#M51988</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="hps"&gt;There is only one&lt;/SPAN&gt; &lt;SPAN class="hps alt-edited"&gt;documented&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;way of modifying&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;dynamic blocks&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;- ObjectARX SDK Docs-&amp;gt; Dynamic Blocks, Protocol Reactors, and Evaluation Graphs-&amp;gt; Dynamic Block API&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Dec 2012 21:31:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/selecting-and-moving-grips-on-dynamic-blocks/m-p/3741190#M51988</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2012-12-20T21:31:11Z</dc:date>
    </item>
    <item>
      <title>Reg:How to set Grip Points</title>
      <link>https://forums.autodesk.com/t5/net-forum/selecting-and-moving-grips-on-dynamic-blocks/m-p/5534214#M51989</link>
      <description>&lt;P&gt;Dear Friend....&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;I tried to create a pipe by using&amp;nbsp;AcDb3dSolid in ObjectArx by C++.But I cant set grip points to that pipe&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;I Want To Create a Pipe(in 3dSolid As like a Cylinder in 3d Solid) between Two Points...&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Then how to set grip Points to the pipe...&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;How to crete it as a Dynamic Block.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Please Give Your Suggestion....&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; Thank you Friend...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;With regards..&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;nathan307&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2015 04:41:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/selecting-and-moving-grips-on-dynamic-blocks/m-p/5534214#M51989</guid>
      <dc:creator>nathan307</dc:creator>
      <dc:date>2015-03-10T04:41:42Z</dc:date>
    </item>
    <item>
      <title>Re: Reg:How to set Grip Points</title>
      <link>https://forums.autodesk.com/t5/net-forum/selecting-and-moving-grips-on-dynamic-blocks/m-p/5534394#M51990</link>
      <description>&lt;P&gt;Please have a look at grip overrules, that is one way to do it. Google will find some texts about it. AFAIK custom entities would be another way. I am a newbie at AutoCAd programming and dont know about dynamic blocks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the .NET forum, there is also an objectArx forum.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2015 09:22:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/selecting-and-moving-grips-on-dynamic-blocks/m-p/5534394#M51990</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-03-10T09:22:02Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting and Moving grips on dynamic blocks?</title>
      <link>https://forums.autodesk.com/t5/net-forum/selecting-and-moving-grips-on-dynamic-blocks/m-p/8098528#M51991</link>
      <description>&lt;P&gt;Hi, have you found the solution to change the position of grips with code? now i'm stuck with the same problem. It seems quite simple, but so hard to achieve...&lt;/P&gt;&lt;P&gt;great thanks to anyone who can help&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jun 2018 17:37:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/selecting-and-moving-grips-on-dynamic-blocks/m-p/8098528#M51991</guid>
      <dc:creator>dnxk</dc:creator>
      <dc:date>2018-06-28T17:37:25Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting and Moving grips on dynamic blocks?</title>
      <link>https://forums.autodesk.com/t5/net-forum/selecting-and-moving-grips-on-dynamic-blocks/m-p/8115790#M51992</link>
      <description>&lt;PRE&gt;    Public Sub ChangeDybpropValue(objID As ObjectId, ByRef trans As Transaction, ByVal sPropertyName As String, ByVal Value As Object)
        Using br As BlockReference = DirectCast(trans.GetObject(objID, OpenMode.ForWrite), BlockReference)
            Using pc As DynamicBlockReferencePropertyCollection = br.DynamicBlockReferencePropertyCollection
                For i As Integer = 0 To pc.Count - 1
                    Dim prop As DynamicBlockReferenceProperty = pc(i)
                    If prop.PropertyName.ToUpper = sPropertyName.ToUpper Then
                        prop.Value = Value
                        Exit For
                    End If
                Next
            End Using
        End Using
    End Sub&lt;/PRE&gt;</description>
      <pubDate>Sat, 07 Jul 2018 20:24:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/selecting-and-moving-grips-on-dynamic-blocks/m-p/8115790#M51992</guid>
      <dc:creator>SRSDS</dc:creator>
      <dc:date>2018-07-07T20:24:03Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting and Moving grips on dynamic blocks?</title>
      <link>https://forums.autodesk.com/t5/net-forum/selecting-and-moving-grips-on-dynamic-blocks/m-p/10718387#M51993</link>
      <description>&lt;P&gt;@Anonymous&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi I am utilizing your move grip point method, which is genius by the way. What I cant figure out is how did you compensate for the block rotation? I am using this to align dynamic block "callouts" (Dynamic Mleaders) I use the following to get the move to location: (the position under the first callout (selectedReferenceCallOut)).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Private Function GetMoveToPoint3d(ByVal selectedReferenceCallOut As ObjectId) As Point3d

        Dim moveToPoint3d As Point3d
        Dim moveToPoint3dX As Double
        Dim moveToPoint3dY As Double

        Try

            Using acDocumentLock As DocumentLock = Active.Document.LockDocument()

                Using acTranaction As Transaction = Active.Database.TransactionManager.StartTransaction()

                    Dim dviewangle = GetCurrentDviewAngle()

                    Dim acBlockReference As BlockReference = CType(acTranaction.GetObject(selectedReferenceCallOut, OpenMode.ForRead), BlockReference)

                    '------------------------- Get X Position -------------------------
                    Dim acGripDataCollection As New GripDataCollection()
                    Dim currentViewUnitSize As Double = 0
                    Dim gripSize As Integer = 0
                    Dim currentViewVector3d As Vector3d = acCurrentDocument.Editor.GetCurrentView().ViewDirection
                    Dim bitFlags As GetGripPointsFlags = GetGripPointsFlags.GripPointsOnly

                    acBlockReference.GetGripPoints(acGripDataCollection, currentViewUnitSize, gripSize, currentViewVector3d, bitFlags)

                    moveToPoint3dX = acGripDataCollection(1).GripPoint.RotateBy(acBlockReference.Rotation, Vector3d.ZAxis, acBlockReference.Position).X

                    '------------------------- Get Y Position -------------------------

                    For Each acAttributeOjectId As ObjectId In acBlockReference.AttributeCollection

                        Dim acAttributeReference = CType(acTranaction.GetObject(acAttributeOjectId, OpenMode.ForRead), AttributeReference)

                        If acAttributeReference.Tag = "INSTALL" Then

                            If acAttributeReference.MTextAttribute.Visible = False Then

                                moveToPoint3dY = acAttributeReference.MTextAttribute.GeometricExtents.MinPoint.RotateBy(acBlockReference.Rotation, Vector3d.ZAxis, acBlockReference.Position).Y + 0.16 ' - acBlockReference.Rotation

                            Else

                                moveToPoint3dY = acAttributeReference.MTextAttribute.GeometricExtents.MinPoint.RotateBy(acBlockReference.Rotation, Vector3d.ZAxis, acBlockReference.Position).Y ' - acBlockReference.Rotation

                            End If

                        End If

                        Exit For

                    Next

                    moveToPoint3d = New Point3d(moveToPoint3dX, moveToPoint3dY, 0)

                    acTranaction.Commit()

                End Using

            End Using

            Return moveToPoint3d

        Catch ex As Exception

            MessageServices.DisplayError("Error Reading Block!", "Could not extract point X and Y positions.", ex)

            Return Nothing

        End Try

    End Function&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And the following to move the the other callouts (selectedCallOutsToMove) to the above move to location... It would move the first one, commit it, and then use the GetMoveToPoint3d on the callout just committed and continue that for each&amp;nbsp;&amp;nbsp;selectedCallOutsToMove. (Iteration left out of code for now as I am just trying to get it to work on one for now.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Private Sub MoveSelectedCallOuts(ByVal selectedReferenceCallOut As ObjectId, ByVal selectedReferenceCallOutPosition As Point3d, ByVal selectedCallOutsToMove As SelectionSet)

        Try

            Using acDocumentLock As DocumentLock = Active.Document.LockDocument()

                Using acTranaction As Transaction = Active.Database.TransactionManager.StartTransaction()

                    Dim dviewangle = GetCurrentDviewAngle()

                    For Each selectedCallOut In selectedCallOutsToMove

                        If selectedCallOut.ObjectId &amp;lt;&amp;gt; selectedReferenceCallOut Then

                            Dim callOutEntity As Entity = CType(acTranaction.GetObject(selectedCallOut.ObjectId, OpenMode.ForWrite), Entity)
                            Dim acBlockReference As BlockReference = TryCast(callOutEntity, BlockReference)

                            Dim acGripDataCollection As New GripDataCollection()
                            Dim updateGrip As New GripDataCollection()
                            Dim currentViewUnitSize As Double = 0
                            Dim gripSize As Integer = 0
                            Dim currentViewVector3d As Vector3d = acCurrentDocument.Editor.GetCurrentView().ViewDirection
                            Dim bitFlags As GetGripPointsFlags = GetGripPointsFlags.GripPointsOnly

                            acBlockReference.GetGripPoints(acGripDataCollection, currentViewUnitSize, gripSize, currentViewVector3d, bitFlags)

                            updateGrip.Add(acGripDataCollection(1))

                            Dim adjustedGripPointLocation = acGripDataCollection(1).GripPoint.RotateBy(acBlockReference.Rotation, Vector3d.ZAxis, acBlockReference.Position)

                            Dim newMoveToVectors = adjustedGripPointLocation.GetVectorTo(selectedReferenceCallOutPosition)
                            acBlockReference.MoveGripPointsAt(updateGrip, newMoveToVectors, MoveGripPointsFlags.Polar)


                        End If

                    Next

                    acTranaction.Commit()

                End Using

            End Using

        Catch ex As Exception

            MessageServices.DisplayError("Error Moving Call Outs!", "Please contact the CADD Department for help.", ex)

        End Try

    End Sub&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It works great when the block is not rotated. I used the Rotate by to compensate for the block rotation and it gets it close but to the exact position.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image (1).png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/982619i389DFD90E1592DB2/image-size/large?v=v2&amp;amp;px=999" role="button" title="image (1).png" alt="image (1).png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Oct 2021 20:11:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/selecting-and-moving-grips-on-dynamic-blocks/m-p/10718387#M51993</guid>
      <dc:creator>David_Prontnicki</dc:creator>
      <dc:date>2021-10-27T20:11:16Z</dc:date>
    </item>
  </channel>
</rss>

