<?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: Help - objects disappearing in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/help-objects-disappearing/m-p/2303290#M18889</link>
    <description>You can simply run a quick code to turn all entities' Visible to True &lt;BR /&gt;
(assume the invisible entity is in ModelSpace):&lt;BR /&gt;
&lt;BR /&gt;
Create a public SUB in a module as macro:&lt;BR /&gt;
&lt;BR /&gt;
Public Sub ShowAllEnt()&lt;BR /&gt;
&lt;BR /&gt;
    Dim ent as AcadEntity&lt;BR /&gt;
    For Each ent in ThisDrawing.ModelSpace&lt;BR /&gt;
        ent.Visible=True&lt;BR /&gt;
    Next&lt;BR /&gt;
&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
Then run the macro.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"bceng" wrote in message news:5985630@discussion.autodesk.com...&lt;BR /&gt;
Yes, that's the line I used by mistake. If I knew the code to turn off the &lt;BR /&gt;
layer of the object I just modified I should have used that instead. But I &lt;BR /&gt;
don't know the code to do that.&lt;BR /&gt;
&lt;BR /&gt;
But now that PickedObj.Visible = False has been used I don't seem to be able &lt;BR /&gt;
to go back from it. The objects made invisible are nowhere I can find. And &lt;BR /&gt;
as I mentioned I saved a few times before I noticed something was wrong.&lt;BR /&gt;
&lt;BR /&gt;
So I guess I need 2 things: the code to turned off the modified object &lt;BR /&gt;
layers and how to find my invisible objects. Thanks.</description>
    <pubDate>Fri, 18 Jul 2008 22:51:48 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2008-07-18T22:51:48Z</dc:date>
    <item>
      <title>Help - objects disappearing</title>
      <link>https://forums.autodesk.com/t5/vba-forum/help-objects-disappearing/m-p/2303287#M18886</link>
      <description>I have the following bit of code which changes the layer of an object. It works fine. However, after changing the layer I erroneously made the object invisible. I should have turned the layer off instead (but I don't know the code for that yet.) &lt;BR /&gt;
&lt;BR /&gt;
Sub SelectOnScreen()&lt;BR /&gt;
    ' This example adds objects to a selection set by prompting the user&lt;BR /&gt;
    ' to select ones to add.&lt;BR /&gt;
    &lt;BR /&gt;
    ' Create the selection set&lt;BR /&gt;
    'On Error Resume Next&lt;BR /&gt;
    Dim ssetObj As AcadSelectionSet&lt;BR /&gt;
    Dim GridSelectionSet As AcadSelectionSet&lt;BR /&gt;
    Set ssetObj = ThisDrawing.SelectionSets.Add("GridSelectionSet")&lt;BR /&gt;
    &lt;BR /&gt;
    ' Add objects to a selection set by prompting user to select on the screen&lt;BR /&gt;
    ssetObj.SelectOnScreen&lt;BR /&gt;
&lt;BR /&gt;
    &lt;BR /&gt;
    Dim objCount As Integer&lt;BR /&gt;
    Dim I As Integer&lt;BR /&gt;
    Dim PickedObj As AcadEntity&lt;BR /&gt;
    &lt;BR /&gt;
    objCount = ssetObj.Count&lt;BR /&gt;
    For I = 0 To 19&lt;BR /&gt;
        Set PickedObj = ssetObj.Item(I)&lt;BR /&gt;
        PickedObj.Layer = ("Grid " &amp;amp; Right(Str(I + 210), 3))&lt;BR /&gt;
        PickedObj.Update&lt;BR /&gt;
        PickedObj.Visible = False&lt;BR /&gt;
    Next I&lt;BR /&gt;
    ssetObj.Clear&lt;BR /&gt;
    ssetObj.Delete&lt;BR /&gt;
    &lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
The problem is is that I didn't notice what was going on until I was almost done with the project and I had already done a number of saves. Now I can't find the objects anywhere. &lt;BR /&gt;
&lt;BR /&gt;
Are they still on the drawing somewhere? I made sure all layers are turned on and I've done Ctrl-A to select all but they seem to be gone. I'd hate to have to re-create a couple hundred objects all over again.</description>
      <pubDate>Fri, 18 Jul 2008 20:49:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/help-objects-disappearing/m-p/2303287#M18886</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-07-18T20:49:14Z</dc:date>
    </item>
    <item>
      <title>Re: Help - objects disappearing</title>
      <link>https://forums.autodesk.com/t5/vba-forum/help-objects-disappearing/m-p/2303288#M18887</link>
      <description>objCount = ssetObj.Count&lt;BR /&gt;
    For I = 0 To 19    &amp;lt;==You may want to replace "19" with "objCount-1"&lt;BR /&gt;
        Set PickedObj = ssetObj.Item(I)&lt;BR /&gt;
        PickedObj.Layer = ("Grid " &amp;amp; Right(Str(I + 210), 3))&lt;BR /&gt;
        PickedObj.Update&lt;BR /&gt;
        PickedObj.Visible = False    &amp;lt;=== Does this "Visible=False" prompt &lt;BR /&gt;
you something?&lt;BR /&gt;
    Next I&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"bceng" wrote in message news:5985516@discussion.autodesk.com...&lt;BR /&gt;
I have the following bit of code which changes the layer of an object. It &lt;BR /&gt;
works fine. However, after changing the layer I erroneously made the object &lt;BR /&gt;
invisible. I should have turned the layer off instead (but I don't know the &lt;BR /&gt;
code for that yet.)&lt;BR /&gt;
&lt;BR /&gt;
Sub SelectOnScreen()&lt;BR /&gt;
    ' This example adds objects to a selection set by prompting the user&lt;BR /&gt;
    ' to select ones to add.&lt;BR /&gt;
&lt;BR /&gt;
    ' Create the selection set&lt;BR /&gt;
    'On Error Resume Next&lt;BR /&gt;
    Dim ssetObj As AcadSelectionSet&lt;BR /&gt;
    Dim GridSelectionSet As AcadSelectionSet&lt;BR /&gt;
    Set ssetObj = ThisDrawing.SelectionSets.Add("GridSelectionSet")&lt;BR /&gt;
&lt;BR /&gt;
    ' Add objects to a selection set by prompting user to select on the &lt;BR /&gt;
screen&lt;BR /&gt;
    ssetObj.SelectOnScreen&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
    Dim objCount As Integer&lt;BR /&gt;
    Dim I As Integer&lt;BR /&gt;
    Dim PickedObj As AcadEntity&lt;BR /&gt;
&lt;BR /&gt;
    objCount = ssetObj.Count&lt;BR /&gt;
    For I = 0 To 19&lt;BR /&gt;
        Set PickedObj = ssetObj.Item(I)&lt;BR /&gt;
        PickedObj.Layer = ("Grid " &amp;amp; Right(Str(I + 210), 3))&lt;BR /&gt;
        PickedObj.Update&lt;BR /&gt;
        PickedObj.Visible = False&lt;BR /&gt;
    Next I&lt;BR /&gt;
    ssetObj.Clear&lt;BR /&gt;
    ssetObj.Delete&lt;BR /&gt;
&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
The problem is is that I didn't notice what was going on until I was almost &lt;BR /&gt;
done with the project and I had already done a number of saves. Now I can't &lt;BR /&gt;
find the objects anywhere.&lt;BR /&gt;
&lt;BR /&gt;
Are they still on the drawing somewhere? I made sure all layers are turned &lt;BR /&gt;
on and I've done Ctrl-A to select all but they seem to be gone. I'd hate to &lt;BR /&gt;
have to re-create a couple hundred objects all over again.</description>
      <pubDate>Fri, 18 Jul 2008 22:32:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/help-objects-disappearing/m-p/2303288#M18887</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-07-18T22:32:34Z</dc:date>
    </item>
    <item>
      <title>Re: Help - objects disappearing</title>
      <link>https://forums.autodesk.com/t5/vba-forum/help-objects-disappearing/m-p/2303289#M18888</link>
      <description>Yes, that's the line I used by mistake. If I knew the code to turn off the layer of the object I just modified I should have used that instead. But I don't know the code to do that.&lt;BR /&gt;
&lt;BR /&gt;
But now that PickedObj.Visible = False has been used I don't seem to be able to go back from it. The objects made invisible are nowhere I can find. And as I mentioned I saved a few times before I noticed something was wrong.&lt;BR /&gt;
&lt;BR /&gt;
So I guess I need 2 things: the code to turned off the modified object layers and how to find my invisible objects. Thanks.</description>
      <pubDate>Fri, 18 Jul 2008 22:41:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/help-objects-disappearing/m-p/2303289#M18888</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-07-18T22:41:58Z</dc:date>
    </item>
    <item>
      <title>Re: Help - objects disappearing</title>
      <link>https://forums.autodesk.com/t5/vba-forum/help-objects-disappearing/m-p/2303290#M18889</link>
      <description>You can simply run a quick code to turn all entities' Visible to True &lt;BR /&gt;
(assume the invisible entity is in ModelSpace):&lt;BR /&gt;
&lt;BR /&gt;
Create a public SUB in a module as macro:&lt;BR /&gt;
&lt;BR /&gt;
Public Sub ShowAllEnt()&lt;BR /&gt;
&lt;BR /&gt;
    Dim ent as AcadEntity&lt;BR /&gt;
    For Each ent in ThisDrawing.ModelSpace&lt;BR /&gt;
        ent.Visible=True&lt;BR /&gt;
    Next&lt;BR /&gt;
&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
Then run the macro.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"bceng" wrote in message news:5985630@discussion.autodesk.com...&lt;BR /&gt;
Yes, that's the line I used by mistake. If I knew the code to turn off the &lt;BR /&gt;
layer of the object I just modified I should have used that instead. But I &lt;BR /&gt;
don't know the code to do that.&lt;BR /&gt;
&lt;BR /&gt;
But now that PickedObj.Visible = False has been used I don't seem to be able &lt;BR /&gt;
to go back from it. The objects made invisible are nowhere I can find. And &lt;BR /&gt;
as I mentioned I saved a few times before I noticed something was wrong.&lt;BR /&gt;
&lt;BR /&gt;
So I guess I need 2 things: the code to turned off the modified object &lt;BR /&gt;
layers and how to find my invisible objects. Thanks.</description>
      <pubDate>Fri, 18 Jul 2008 22:51:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/help-objects-disappearing/m-p/2303290#M18889</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-07-18T22:51:48Z</dc:date>
    </item>
    <item>
      <title>Re: Help - objects disappearing</title>
      <link>https://forums.autodesk.com/t5/vba-forum/help-objects-disappearing/m-p/2303291#M18890</link>
      <description>Ah great! That worked. Thanks so much. I love doing code but it does make things so much easier and faster when I know what I'm allowed to write. The Help files are ok but sometimes you need a help file just to use the help file. &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;</description>
      <pubDate>Mon, 21 Jul 2008 12:45:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/help-objects-disappearing/m-p/2303291#M18890</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-07-21T12:45:48Z</dc:date>
    </item>
  </channel>
</rss>

