<?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: Convert a group of objects to jig and insert with preview in modelspace in Civil 3D Customization Forum</title>
    <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/convert-a-group-of-objects-to-jig-and-insert-with-preview-in/m-p/5962488#M14919</link>
    <description>&lt;P&gt;i got these codes tested it's quite good. just need to change a bit to work with my programs. also add a checkbox to turn the rotation on and off.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks Jeff. that is good we reference.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 22 Dec 2015 20:00:08 GMT</pubDate>
    <dc:creator>wang890</dc:creator>
    <dc:date>2015-12-22T20:00:08Z</dc:date>
    <item>
      <title>Convert a group of objects to jig and insert with preview in modelspace</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/convert-a-group-of-objects-to-jig-and-insert-with-preview-in/m-p/5921318#M14911</link>
      <description>&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;currently i have programs which create many objects and insert as a group. but without a preview. then i learnt this thing jig but never used it. my block contain even some civil 3d objects only feature lines, and autocad arcs, lines, text.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can you easily pass a group to a block and then to a jig and at insertion time explode it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;no need to generate gif preview in the windows form just in the modelspace like when insert a block you can see the pseudo objects moving around as your cursor moving around but don't need to have rotation parameters.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;any code can help would be great.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Nov 2015 18:53:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/convert-a-group-of-objects-to-jig-and-insert-with-preview-in/m-p/5921318#M14911</guid>
      <dc:creator>wang890</dc:creator>
      <dc:date>2015-11-23T18:53:02Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a group of objects to jig and insert with preview in modelspace</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/convert-a-group-of-objects-to-jig-and-insert-with-preview-in/m-p/5921601#M14912</link>
      <description>Here is an example of creating a BlockJig:&lt;BR /&gt;&lt;A href="http://adndevblog.typepad.com/autocad/2012/07/how-to-show-a-block-when-positioning-it-using-c.html" target="_blank"&gt;http://adndevblog.typepad.com/autocad/2012/07/how-to-show-a-block-when-positioning-it-using-c.html&lt;/A&gt;</description>
      <pubDate>Mon, 23 Nov 2015 21:02:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/convert-a-group-of-objects-to-jig-and-insert-with-preview-in/m-p/5921601#M14912</guid>
      <dc:creator>Jeff_M</dc:creator>
      <dc:date>2015-11-23T21:02:10Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a group of objects to jig and insert with preview in modelspace</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/convert-a-group-of-objects-to-jig-and-insert-with-preview-in/m-p/5922139#M14913</link>
      <description>&lt;P&gt;thanks jeff for the link, it didn't show up in my search before online. i tried and works great. should be enough to solve my problems.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Nov 2015 07:10:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/convert-a-group-of-objects-to-jig-and-insert-with-preview-in/m-p/5922139#M14913</guid>
      <dc:creator>wang890</dc:creator>
      <dc:date>2015-11-24T07:10:17Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a group of objects to jig and insert with preview in modelspace</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/convert-a-group-of-objects-to-jig-and-insert-with-preview-in/m-p/5949610#M14914</link>
      <description>&lt;P&gt;Hi Jeff&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I figure out the jig to work with my code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;how ever now i am told to get the objects to have rotation option.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i am creating a fake block to show the objects just for the jig preview features so user can place the objects then i am still using my other code to create all the objects into a group. i didn't want to create the block and explode because i couldn't figure out how to keep the group options. also there are civil 3d objects in the group. once made into block gets messed up. so i keep all the alignments and feature line objects in the group which is created after creating the dummy block for jig with only autocad objects.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i am thinking i will use the same block to show the rotation preview factor and obtain the angle user picked. then apply it to the group. not even sure how to rotate the group. it's really easy to rotate manually these guys are just lazy lol.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here's the code which pass a block and report back the insertion point back to other code. so maybe someone may find this useful.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Imports Autodesk.AutoCAD.Geometry
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.EditorInput
Imports Autodesk.AutoCAD.Runtime


Public Class BlockJig

    ' Ask the user to place the block named ("TEMPBLOCK_NET"), showing it
    '   during the dragging.
    ' Make sure that a block with this name exists in the drawing.
    '===============================================================
    Public Shared Sub BlockJig(sName As String, ByRef oInsertPT As Point3d, ByRef res As PromptResult)
        Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor
        Dim db As Database = ed.Document.Database
        Try
            Using tr As Transaction = db.TransactionManager.StartTransaction()
                ' Find the ("TEMPBLOCK_NET") block in the current drawing
                Dim bt As BlockTable = DirectCast(tr.GetObject(db.BlockTableId, OpenMode.ForWrite）， BlockTable)
                Dim block As BlockTableRecord = DirectCast(tr.GetObject(bt(sName), OpenMode.ForWrite), BlockTableRecord)

                ' Create the Jig and ask the user to place the block
                '----------------------------------------------------
                Dim blockJig__1 As New MyBlockJig()
                Dim point As Point3d
                res = blockJig__1.DragMe(block.ObjectId, point)

                oInsertPT = blockJig__1._point

                block.Erase()
                tr.Commit()
                ' using
            End Using
        Catch ex As System.Exception
            ed.WriteMessage(ex.ToString())
        End Try
    End Sub
    ' BlockJig()
End Class
' class BlockJigCmds

' This Jig will show the given block during the dragging.
'=================================================================
Public Class MyBlockJig
    Inherits DrawJig
    Public _point As Point3d
    Private _blockId As ObjectId = ObjectId.Null

    ' Shows the block until the user clicks a point.
    ' The 1st parameter is the Id of the block definition.
    ' The 2nd is the clicked point.
    '---------------------------------------------------------------
    Public Function DragMe(i_blockId As ObjectId, ByRef o_pnt As Point3d) As PromptResult
        _blockId = i_blockId
        Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor

        Dim jigRes As PromptResult = ed.Drag(Me)
        o_pnt = _point
        Return jigRes
    End Function


    ' Need to override this method.
    ' Updating the current position of the block.
    '--------------------------------------------------------------
    Protected Overrides Function Sampler(prompts As JigPrompts) As SamplerStatus
        Dim jigOpts As New JigPromptPointOptions()
        jigOpts.UserInputControls = (UserInputControls.Accept3dCoordinates Or UserInputControls.NullResponseAccepted)
        jigOpts.Message = "Select a point:"
        Dim jigRes As PromptPointResult = prompts.AcquirePoint(jigOpts)

        Dim pt As Point3d = jigRes.Value
        If pt = _point Then
            Return SamplerStatus.NoChange
        End If

        _point = pt
        If jigRes.Status = PromptStatus.OK Then
            Return SamplerStatus.OK
        End If

        Return SamplerStatus.Cancel
    End Function


    ' Need to override this method.
    ' We are showing our block in its current position here.
    '--------------------------------------------------------------
    Protected Overrides Function WorldDraw(draw As Autodesk.AutoCAD.GraphicsInterface.WorldDraw) As Boolean
        Dim inMemoryBlockInsert As New BlockReference(_point, _blockId)
        draw.Geometry.Draw(inMemoryBlockInsert)

        inMemoryBlockInsert.Dispose()

        Return True
    End Function
    ' WorldDraw()
End Class&lt;/PRE&gt;</description>
      <pubDate>Mon, 14 Dec 2015 03:26:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/convert-a-group-of-objects-to-jig-and-insert-with-preview-in/m-p/5949610#M14914</guid>
      <dc:creator>wang890</dc:creator>
      <dc:date>2015-12-14T03:26:23Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a group of objects to jig and insert with preview in modelspace</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/convert-a-group-of-objects-to-jig-and-insert-with-preview-in/m-p/5954116#M14915</link>
      <description>&lt;P&gt;Bob, here's an example to insert and rotate a block reference:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://forums.autodesk.com/t5/net/rotate-prior-to-insertion-of-block/m-p/5013336#M40462" target="_blank"&gt;http://forums.autodesk.com/t5/net/rotate-prior-to-insertion-of-block/m-p/5013336#M40462&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To rotate a group you'd need to use TransformBy() on each object in the group. Remember, a Group is essentially a saved selection set.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2015 15:17:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/convert-a-group-of-objects-to-jig-and-insert-with-preview-in/m-p/5954116#M14915</guid>
      <dc:creator>Jeff_M</dc:creator>
      <dc:date>2015-12-16T15:17:34Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a group of objects to jig and insert with preview in modelspace</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/convert-a-group-of-objects-to-jig-and-insert-with-preview-in/m-p/5954787#M14916</link>
      <description>Could you give an example of which objects you create in a group and then wish to move/rotate? I'm thinking there's a better way than using the Blockjig....but I need some sort of dwg and/or code to test with.</description>
      <pubDate>Wed, 16 Dec 2015 20:07:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/convert-a-group-of-objects-to-jig-and-insert-with-preview-in/m-p/5954787#M14916</guid>
      <dc:creator>Jeff_M</dc:creator>
      <dc:date>2015-12-16T20:07:05Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a group of objects to jig and insert with preview in modelspace</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/convert-a-group-of-objects-to-jig-and-insert-with-preview-in/m-p/5959640#M14917</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/379478"&gt;@wang890﻿&lt;/a&gt;, I was doing some more searching &amp;amp; testing with this, as I think I may have a use for something like this later. I found &lt;A href="http://spiderinnet1.typepad.com/blog/2012/06/autocad-net-use-drawjig-to-dynamically-move-rotate-and-scale-multiple-entities-of-any-kinds.html" target="_blank"&gt;THIS&lt;/A&gt; article over on Spiderinnet's blog. It shows how to use DrawJig, instead of EntityJig, to MoveRotateScale multiple objects (and works with Groups). This allows you to do the Move/Rotate using the C3D objects since no block is needed. Notice I omitted the Scale portion...it fails on the objects I was testing with and I didn't need it anyway so i removed that portion for my testing. I think that this is more what you were looking for.&lt;/P&gt;</description>
      <pubDate>Sun, 20 Dec 2015 17:57:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/convert-a-group-of-objects-to-jig-and-insert-with-preview-in/m-p/5959640#M14917</guid>
      <dc:creator>Jeff_M</dc:creator>
      <dc:date>2015-12-20T17:57:15Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a group of objects to jig and insert with preview in modelspace</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/convert-a-group-of-objects-to-jig-and-insert-with-preview-in/m-p/5959792#M14918</link>
      <description>&lt;P&gt;Hi Jeff&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here is the code for the program. sorry i have been busy with my real job.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;marry christms&lt;/P&gt;</description>
      <pubDate>Mon, 21 Dec 2015 00:17:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/convert-a-group-of-objects-to-jig-and-insert-with-preview-in/m-p/5959792#M14918</guid>
      <dc:creator>wang890</dc:creator>
      <dc:date>2015-12-21T00:17:27Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a group of objects to jig and insert with preview in modelspace</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/convert-a-group-of-objects-to-jig-and-insert-with-preview-in/m-p/5962488#M14919</link>
      <description>&lt;P&gt;i got these codes tested it's quite good. just need to change a bit to work with my programs. also add a checkbox to turn the rotation on and off.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks Jeff. that is good we reference.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Dec 2015 20:00:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/convert-a-group-of-objects-to-jig-and-insert-with-preview-in/m-p/5962488#M14919</guid>
      <dc:creator>wang890</dc:creator>
      <dc:date>2015-12-22T20:00:08Z</dc:date>
    </item>
  </channel>
</rss>

