<?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: Select blocks in current paperspace in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/select-blocks-in-current-paperspace/m-p/5465452#M41739</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use the layout name in a selection filter with 410 dxf code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;TypedValue[] filList = new TypedValue[2]
{ 
    new TypedValue(0,"INSERT"),
    new TypedValue(410, "Layout1")
};&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;If you want to get the current layout name, you can use the CTAB system variable.&lt;/P&gt;
&lt;PRE&gt;string ctab =
    (string)HostApplicationServices.WorkingDatabase.GetSystemVariable("CTAB");
TypedValue[] filList = new TypedValue[2]
{ 
    new TypedValue(0,"INSERT"),
    new TypedValue(410, ctab)
};&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 11 Jan 2015 13:52:26 GMT</pubDate>
    <dc:creator>_gile</dc:creator>
    <dc:date>2015-01-11T13:52:26Z</dc:date>
    <item>
      <title>Select blocks in current paperspace</title>
      <link>https://forums.autodesk.com/t5/net-forum/select-blocks-in-current-paperspace/m-p/5465389#M41735</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;Bit of a c# newbie so please excuse me if this is an obvious question.&lt;/P&gt;&lt;P&gt;Wrtitng some code where i want to select all blocks in the current paperspace.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know i can use this code to select all blocks in all paperspace but wondered if there is a way to refine it to do what i want to do?&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P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 11 Jan 2015 09:30:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/select-blocks-in-current-paperspace/m-p/5465389#M41735</guid>
      <dc:creator>miketurpin_innovatingfutures</dc:creator>
      <dc:date>2015-01-11T09:30:07Z</dc:date>
    </item>
    <item>
      <title>Re: Select blocks in current paperspace</title>
      <link>https://forums.autodesk.com/t5/net-forum/select-blocks-in-current-paperspace/m-p/5465409#M41736</link>
      <description>there is only one (currrent) Paperspace, so 67==1 select block REFERENCES for the active Layout only.&lt;BR /&gt;</description>
      <pubDate>Sun, 11 Jan 2015 11:30:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/select-blocks-in-current-paperspace/m-p/5465409#M41736</guid>
      <dc:creator>SENL1362</dc:creator>
      <dc:date>2015-01-11T11:30:28Z</dc:date>
    </item>
    <item>
      <title>Re: Select blocks in current paperspace</title>
      <link>https://forums.autodesk.com/t5/net-forum/select-blocks-in-current-paperspace/m-p/5465411#M41737</link>
      <description>&lt;P&gt;You can get the block the selected entity belongs to you using the following :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;                foreach (ObjectId entId in selectedIds)
                {

                    Entity ent = (Entity)tr.GetObject(entId, OpenMode.ForRead);
                    BlockTableRecord parentBlk = (BlockTableRecord)tr.GetObject(ent.OwnerId, OpenMode.ForRead);
                    ed.WriteMessage("\n DxfName={0}, EntType={1}, Handle={2}, Layer={3}, Block={4}", entID.ObjectClass.DxfName,ent.GetType().ToString() , ent.Handle.ToString(), ent.Layer.ToString(), parentBlk.Name);
                }&lt;BR /&gt;&lt;BR /&gt;The block is the modelspace or the Block for the (Current) Layout (layout.BlockTableRecordId)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 11 Jan 2015 11:43:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/select-blocks-in-current-paperspace/m-p/5465411#M41737</guid>
      <dc:creator>SENL1362</dc:creator>
      <dc:date>2015-01-11T11:43:45Z</dc:date>
    </item>
    <item>
      <title>Re: Select blocks in current paperspace</title>
      <link>https://forums.autodesk.com/t5/net-forum/select-blocks-in-current-paperspace/m-p/5465446#M41738</link>
      <description>&lt;P&gt;SENL1367,&lt;/P&gt;&lt;P&gt;Thanks for the reply but not sure i understand.&lt;/P&gt;&lt;P&gt;I have a drawing with 5 drawing sheets (in 5 paperspaces) and i want to select all of the blocks in the paperspace the user is currently viewing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The (67,1) seems to select from all 5 paperspaces not just the current one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again for your help&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;</description>
      <pubDate>Sun, 11 Jan 2015 13:27:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/select-blocks-in-current-paperspace/m-p/5465446#M41738</guid>
      <dc:creator>miketurpin_innovatingfutures</dc:creator>
      <dc:date>2015-01-11T13:27:08Z</dc:date>
    </item>
    <item>
      <title>Re: Select blocks in current paperspace</title>
      <link>https://forums.autodesk.com/t5/net-forum/select-blocks-in-current-paperspace/m-p/5465452#M41739</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use the layout name in a selection filter with 410 dxf code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;TypedValue[] filList = new TypedValue[2]
{ 
    new TypedValue(0,"INSERT"),
    new TypedValue(410, "Layout1")
};&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;If you want to get the current layout name, you can use the CTAB system variable.&lt;/P&gt;
&lt;PRE&gt;string ctab =
    (string)HostApplicationServices.WorkingDatabase.GetSystemVariable("CTAB");
TypedValue[] filList = new TypedValue[2]
{ 
    new TypedValue(0,"INSERT"),
    new TypedValue(410, ctab)
};&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 11 Jan 2015 13:52:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/select-blocks-in-current-paperspace/m-p/5465452#M41739</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2015-01-11T13:52:26Z</dc:date>
    </item>
  </channel>
</rss>

