<?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: XDATA: Please explain what I've done (Jeff) in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/xdata-please-explain-what-i-ve-done-jeff/m-p/2056638#M147906</link>
    <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
Only then when there is a frozen layer in the viewport the code 1003 will be present.&lt;BR /&gt;
&lt;BR /&gt;
The paperspace viewport (mostly Viewport 1) has in this case no frozen layers&lt;BR /&gt;
&lt;BR /&gt;
i have modified your code that there is no frozen layers it's not in the VPF_layerlist &lt;BR /&gt;
&lt;BR /&gt;
(setq VPF_ss (ssget "X" '((0 . "VIEWPORT")))&lt;BR /&gt;
VPF_layerlist nil&lt;BR /&gt;
VPF_count1 0&lt;BR /&gt;
)&lt;BR /&gt;
(if VPF_ss&lt;BR /&gt;
(progn&lt;BR /&gt;
(while (&amp;lt; VPF_count1 (sslength VPF_ss))&lt;BR /&gt;
(setq VPF_ent (ssname VPF_ss VPF_count1)&lt;BR /&gt;
VPF_cont (entget VPF_ent)&lt;BR /&gt;
VPF_viewportID (cdr (assoc 69 VPF_cont))&lt;BR /&gt;
)&lt;BR /&gt;
(vla-GetXData (vlax-ename-&amp;gt;vla-object (ssname VPF_ss VPF_count1)) "ACAD" 'VPF_XDataType 'VPF_XDataValue)&lt;BR /&gt;
(setq VPF_codelist (vlax-safearray-&amp;gt;list VPF_XDataType)&lt;BR /&gt;
VPF_valuelist (vlax-safearray-&amp;gt;list VPF_XDataValue)&lt;BR /&gt;
)&lt;BR /&gt;
(if (setq VPF_templist (vl-remove nil (mapcar '(lambda(x y)(if (= 1003 x)(vlax-variant-value y))) VPF_codelist VPF_valuelist)))&lt;BR /&gt;
(setq VPF_layerlist (append VPF_layerlist (list (cons VPF_viewportID (list VPF_templist)))))&lt;BR /&gt;
)&lt;BR /&gt;
(setq VPF_count1 (1+ VPF_count1))&lt;BR /&gt;
)&lt;BR /&gt;
)&lt;BR /&gt;
)&lt;BR /&gt;
Cheers&lt;BR /&gt;
Harrie</description>
    <pubDate>Fri, 31 Aug 2007 12:49:59 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2007-08-31T12:49:59Z</dc:date>
    <item>
      <title>XDATA: Please explain what I've done (Jeff)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/xdata-please-explain-what-i-ve-done-jeff/m-p/2056637#M147905</link>
      <description>I got this code from one of Jeff M's posts and modified it slightly to give me a list of Viewport IDs and layers frozen in each viewport:&lt;BR /&gt;
(setq VPF_ss (ssget "X" '((0 . "VIEWPORT")))&lt;BR /&gt;
VPF_layerlist nil&lt;BR /&gt;
VPF_count1 0&lt;BR /&gt;
)&lt;BR /&gt;
(if VPF_ss&lt;BR /&gt;
(progn&lt;BR /&gt;
(while (&amp;lt; VPF_count1 (sslength VPF_ss))&lt;BR /&gt;
(setq VPF_ent (ssname VPF_ss VPF_count1)&lt;BR /&gt;
VPF_cont (entget VPF_ent)&lt;BR /&gt;
VPF_viewportID (cdr (assoc 69 VPF_cont))&lt;BR /&gt;
)&lt;BR /&gt;
(vla-GetXData (vlax-ename-&amp;gt;vla-object (ssname VPF_ss VPF_count1)) "ACAD" 'VPF_XDataType 'VPF_XDataValue)&lt;BR /&gt;
(setq VPF_codelist (vlax-safearray-&amp;gt;list VPF_XDataType)&lt;BR /&gt;
VPF_valuelist (vlax-safearray-&amp;gt;list VPF_XDataValue)&lt;BR /&gt;
VPF_templist nil&lt;BR /&gt;
VPF_count2 0&lt;BR /&gt;
)&lt;BR /&gt;
(foreach VPF_nth VPF_codelist&lt;BR /&gt;
(if (= 1003 VPF_nth)&lt;BR /&gt;
(setq VPF_templist (append VPF_templist (list (vlax-variant-value (nth VPF_count2 VPF_valuelist)))))&lt;BR /&gt;
)&lt;BR /&gt;
(setq VPF_count2 (1+ VPF_count2))&lt;BR /&gt;
)&lt;BR /&gt;
(setq VPF_layerlist (append VPF_layerlist (list (cons VPF_viewportID (list VPF_templist)))))&lt;BR /&gt;
(setq VPF_count1 (1+ VPF_count1))&lt;BR /&gt;
)&lt;BR /&gt;
)&lt;BR /&gt;
)&lt;BR /&gt;
&lt;BR /&gt;
returns: ((3 ("Layer2" "Layer4")) (2 ("Layer2" "Layer3")) (1 nil))&lt;BR /&gt;
&lt;BR /&gt;
I staggered about blindly in the original code and managed to come out at the end with the result that I wanted. But how?&lt;BR /&gt;
&lt;BR /&gt;
The thing that's confusing me is the 1003. I found that this is the layer name, but 1003 doesn't appear in VPF_codelist so how can the foreach statement catch it? Also, where exactly does the code determine that the layer is frozen in the viewport?&lt;BR /&gt;
&lt;BR /&gt;
Any help on this would be greatly appreciated.&lt;BR /&gt;
&lt;BR /&gt;
S</description>
      <pubDate>Thu, 30 Aug 2007 01:53:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/xdata-please-explain-what-i-ve-done-jeff/m-p/2056637#M147905</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-08-30T01:53:22Z</dc:date>
    </item>
    <item>
      <title>Re: XDATA: Please explain what I've done (Jeff)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/xdata-please-explain-what-i-ve-done-jeff/m-p/2056638#M147906</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
Only then when there is a frozen layer in the viewport the code 1003 will be present.&lt;BR /&gt;
&lt;BR /&gt;
The paperspace viewport (mostly Viewport 1) has in this case no frozen layers&lt;BR /&gt;
&lt;BR /&gt;
i have modified your code that there is no frozen layers it's not in the VPF_layerlist &lt;BR /&gt;
&lt;BR /&gt;
(setq VPF_ss (ssget "X" '((0 . "VIEWPORT")))&lt;BR /&gt;
VPF_layerlist nil&lt;BR /&gt;
VPF_count1 0&lt;BR /&gt;
)&lt;BR /&gt;
(if VPF_ss&lt;BR /&gt;
(progn&lt;BR /&gt;
(while (&amp;lt; VPF_count1 (sslength VPF_ss))&lt;BR /&gt;
(setq VPF_ent (ssname VPF_ss VPF_count1)&lt;BR /&gt;
VPF_cont (entget VPF_ent)&lt;BR /&gt;
VPF_viewportID (cdr (assoc 69 VPF_cont))&lt;BR /&gt;
)&lt;BR /&gt;
(vla-GetXData (vlax-ename-&amp;gt;vla-object (ssname VPF_ss VPF_count1)) "ACAD" 'VPF_XDataType 'VPF_XDataValue)&lt;BR /&gt;
(setq VPF_codelist (vlax-safearray-&amp;gt;list VPF_XDataType)&lt;BR /&gt;
VPF_valuelist (vlax-safearray-&amp;gt;list VPF_XDataValue)&lt;BR /&gt;
)&lt;BR /&gt;
(if (setq VPF_templist (vl-remove nil (mapcar '(lambda(x y)(if (= 1003 x)(vlax-variant-value y))) VPF_codelist VPF_valuelist)))&lt;BR /&gt;
(setq VPF_layerlist (append VPF_layerlist (list (cons VPF_viewportID (list VPF_templist)))))&lt;BR /&gt;
)&lt;BR /&gt;
(setq VPF_count1 (1+ VPF_count1))&lt;BR /&gt;
)&lt;BR /&gt;
)&lt;BR /&gt;
)&lt;BR /&gt;
Cheers&lt;BR /&gt;
Harrie</description>
      <pubDate>Fri, 31 Aug 2007 12:49:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/xdata-please-explain-what-i-ve-done-jeff/m-p/2056638#M147906</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-08-31T12:49:59Z</dc:date>
    </item>
    <item>
      <title>Re: XDATA: Please explain what I've done (Jeff)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/xdata-please-explain-what-i-ve-done-jeff/m-p/2056639#M147907</link>
      <description>Scott,&lt;BR /&gt;
As Harrie points out, the 1003 code will only be present if there are layers &lt;BR /&gt;
frozen in the Viewport, which is why the first VP returns nil, since it is &lt;BR /&gt;
the View of the Paperspace Layout.&lt;BR /&gt;
&lt;BR /&gt;
Here's a quick dump of a VP object using (entget) so you can see that the &lt;BR /&gt;
data is there. Note the 1003 Groups near the end. These are the layers &lt;BR /&gt;
frozen in that VP. HTH.&lt;BR /&gt;
&lt;BR /&gt;
Command: (entget (car (entsel)) '("ACAD"))&lt;BR /&gt;
&lt;BR /&gt;
Select object: ((-1 . &lt;ENTITY ="" 4008bf60=""&gt;) (0 . "VIEWPORT") (330 . &lt;BR /&gt;
&lt;ENTITY&gt;&lt;BR /&gt;
name: 40083cc8&amp;gt;) (5 . "77C2BFCE2783B58C") (100 . "AcDbEntity") (67 . 1) (410 &lt;BR /&gt;
..&lt;BR /&gt;
"Layout1") (8 . "VPORTS") (100 . "AcDbViewport") (10 17.5964 12.1314 0.0) &lt;BR /&gt;
(40 .&lt;BR /&gt;
30.4121) (41 . 21.5926) (68 . 2) (69 . 2) (12 10948.4 3972.6 0.0) (13 0.0 &lt;BR /&gt;
0.0&lt;BR /&gt;
0.0) (14 5.0 5.0 0.0) (15 5.0 5.0 0.0) (16 0.0 0.0 1.0) (17 0.0 0.0 0.0) (42 &lt;BR /&gt;
..&lt;BR /&gt;
50.0) (43 . 0.0) (44 . 0.0) (45 . 431.851) (50 . 0.0) (51 . 0.0) (72 . &lt;BR /&gt;
10000)&lt;BR /&gt;
(341 . &lt;ENTITY ="" 40085298=""&gt;) (341 . &lt;ENTITY ="" 40085438=""&gt;) (90 . 49152)&lt;BR /&gt;
(281 . 0) (71 . 1) (74 . 0) (110 0.0 0.0 0.0) (111 1.0 0.0 0.0) (112 0.0 1.0&lt;BR /&gt;
0.0) (79 . 0) (146 . 0.0) (-3 ("ACAD" (1000 . "MVIEW") (1002 . "{") (1070 . &lt;BR /&gt;
16)&lt;BR /&gt;
(1010 0.0 0.0 0.0) (1010 0.0 0.0 1.0) (1040 . 0.0) (1040 . 431.851) (1040 .&lt;BR /&gt;
10948.4) (1040 . 3972.6) (1040 . 50.0) (1040 . 0.0) (1040 . 0.0) (1070 . 0)&lt;BR /&gt;
(1070 . 10000) (1070 . 1) (1070 . 0) (1070 . 0) (1070 . 0) (1070 . 0) (1070 &lt;BR /&gt;
..&lt;BR /&gt;
0) (1040 . 0.0) (1040 . 0.0) (1040 . 0.0) (1040 . 5.0) (1040 . 5.0) (1040 .&lt;BR /&gt;
5.0) (1040 . 5.0) (1070 . 0) (1002 . "{") (1003 . "EX-LIP") (1003 . &lt;BR /&gt;
"EX-ELEC")&lt;BR /&gt;
(1002 . "}") (1002 . "}"))))&lt;BR /&gt;
&lt;BR /&gt;
&lt;SCOTTBOLTON&gt; wrote in message news:5705296@discussion.autodesk.com...&lt;BR /&gt;
I got this code from one of Jeff M's posts and modified it slightly to give &lt;BR /&gt;
me a list of Viewport IDs and layers frozen in each viewport:&lt;BR /&gt;
The thing that's confusing me is the 1003. I found that this is the layer &lt;BR /&gt;
name, but 1003 doesn't appear in VPF_codelist so how can the foreach &lt;BR /&gt;
statement catch it? Also, where exactly does the code determine that the &lt;BR /&gt;
layer is frozen in the viewport?&lt;BR /&gt;
&lt;BR /&gt;
Any help on this would be greatly appreciated.&lt;BR /&gt;
&lt;BR /&gt;
S&lt;/SCOTTBOLTON&gt;&lt;/ENTITY&gt;&lt;/ENTITY&gt;&lt;/ENTITY&gt;&lt;/ENTITY&gt;</description>
      <pubDate>Fri, 31 Aug 2007 14:16:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/xdata-please-explain-what-i-ve-done-jeff/m-p/2056639#M147907</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-08-31T14:16:18Z</dc:date>
    </item>
    <item>
      <title>Re: XDATA: Please explain what I've done (Jeff)</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/xdata-please-explain-what-i-ve-done-jeff/m-p/2056640#M147908</link>
      <description>Harrie &amp;amp; Jeff,&lt;BR /&gt;
&lt;BR /&gt;
Thanks for your responses. It makes sense to me now. I've just found the Extended Data section in the help file (DXF &amp;gt; Advanced DXF) and see that 1003 is listed as 'layer associated with the ex. data'.&lt;BR /&gt;
&lt;BR /&gt;
I've still a lot to learn regarding XDATA, but at least my eyes are a little more open now.&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
&lt;BR /&gt;
S</description>
      <pubDate>Fri, 31 Aug 2007 14:27:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/xdata-please-explain-what-i-ve-done-jeff/m-p/2056640#M147908</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-08-31T14:27:19Z</dc:date>
    </item>
  </channel>
</rss>

