<?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: CHSPACE in Viewport programmatically? in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/chspace-in-viewport-programmatically/m-p/4422737#M48265</link>
    <description>&lt;P&gt;Is this what you are after?&lt;/P&gt;&lt;P&gt;&lt;A title="Selecting Model Space entities from Paper Space" href="http://adndevblog.typepad.com/autocad/2012/04/selecting-model-space-entities-from-paper-space-using-autocad-selection-sets-in-c.html" target="_self"&gt;Selecting Model Space entities from Paper Space&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 13 Sep 2013 00:52:40 GMT</pubDate>
    <dc:creator>matt.worland</dc:creator>
    <dc:date>2013-09-13T00:52:40Z</dc:date>
    <item>
      <title>CHSPACE in Viewport programmatically?</title>
      <link>https://forums.autodesk.com/t5/net-forum/chspace-in-viewport-programmatically/m-p/4364443#M48263</link>
      <description>&lt;PRE&gt;&lt;SPAN class="short_text"&gt;&lt;SPAN class="hps"&gt;&lt;BR /&gt;Need to get inside the viewport in paperspace and run the command CHSPACE to bring some layers to the modelspace viewport. How to do this programmatically?&lt;BR /&gt;&lt;BR /&gt;The&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;principle&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;is&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;as follows:&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;BR /&gt;&lt;BR /&gt;[CommandMethod("ChangeViewports")]
        public static void ChangeViewports()
        {
            Document document = Application.DocumentManager.MdiActiveDocument;
            Database database = document.Database;
            Editor editor = document.Editor;

            using (Transaction transaction = database.TransactionManager.StartTransaction())
            {
                ObjectIdCollection objectIdCollection = database.GetViewports(false);

                foreach (ObjectId id in objectIdCollection)
                {
                    Viewport viewport = transaction.GetObject(id, OpenMode.ForWrite) as Viewport;
                    if (viewport.StandardScale == StandardScaleType.Scale1To1)
                        viewport.Erase();
                    else
                    {
                        //Run this command CHSPACE viewport
                    }
                    
                }
                transaction.Commit();
            }
        }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="hps"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="hps"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="hps"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="hps"&gt;Thank you&lt;/SPAN&gt;&lt;/SPAN&gt;!&lt;/P&gt;</description>
      <pubDate>Tue, 13 Aug 2013 11:26:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/chspace-in-viewport-programmatically/m-p/4364443#M48263</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-08-13T11:26:20Z</dc:date>
    </item>
    <item>
      <title>Re: CHSPACE in Viewport programmatically?</title>
      <link>https://forums.autodesk.com/t5/net-forum/chspace-in-viewport-programmatically/m-p/4416865#M48264</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can run a command using Document.SendStringToExecute. However I don't really understand the point of your question as same layers exist in both model and paper spaces, I don't see how you're going to use CHSPACE to import a layer from model to paper, this command only applies to entities...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Philippe.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Sep 2013 08:36:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/chspace-in-viewport-programmatically/m-p/4416865#M48264</guid>
      <dc:creator>philippe.leefsma</dc:creator>
      <dc:date>2013-09-11T08:36:52Z</dc:date>
    </item>
    <item>
      <title>Re: CHSPACE in Viewport programmatically?</title>
      <link>https://forums.autodesk.com/t5/net-forum/chspace-in-viewport-programmatically/m-p/4422737#M48265</link>
      <description>&lt;P&gt;Is this what you are after?&lt;/P&gt;&lt;P&gt;&lt;A title="Selecting Model Space entities from Paper Space" href="http://adndevblog.typepad.com/autocad/2012/04/selecting-model-space-entities-from-paper-space-using-autocad-selection-sets-in-c.html" target="_self"&gt;Selecting Model Space entities from Paper Space&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Sep 2013 00:52:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/chspace-in-viewport-programmatically/m-p/4422737#M48265</guid>
      <dc:creator>matt.worland</dc:creator>
      <dc:date>2013-09-13T00:52:40Z</dc:date>
    </item>
    <item>
      <title>Re: CHSPACE in Viewport programmatically?</title>
      <link>https://forums.autodesk.com/t5/net-forum/chspace-in-viewport-programmatically/m-p/4616887#M48266</link>
      <description>I need the same. I think he means copy objects (not just layers) from MS to PS. My need is to copy a selected closed polyline from MS to PS, suitably scaled to match the VP. [Selecting Model Space entities from Paper Space] just creates a selection set based on the viewport window. Not quite the same. Dale&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 13 Nov 2013 10:06:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/chspace-in-viewport-programmatically/m-p/4616887#M48266</guid>
      <dc:creator>Dale.Bartlett</dc:creator>
      <dc:date>2013-11-13T10:06:33Z</dc:date>
    </item>
  </channel>
</rss>

