<?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: Layer Insert in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/layer-insert/m-p/2036935#M24020</link>
    <description>Hay, Bharati&lt;BR /&gt;
I'm still working on that&lt;BR /&gt;
Do not hurry me up, please, be patience&lt;BR /&gt;
This will be a long story, as you guess&lt;BR /&gt;
Say 1-2 days or so&lt;BR /&gt;
I can't to write quickly than I can&lt;BR /&gt;
&lt;BR /&gt;
~'J'~</description>
    <pubDate>Tue, 07 Aug 2007 09:54:08 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2007-08-07T09:54:08Z</dc:date>
    <item>
      <title>Layer Insert</title>
      <link>https://forums.autodesk.com/t5/vba-forum/layer-insert/m-p/2036928#M24013</link>
      <description>Hai,&lt;BR /&gt;
&lt;BR /&gt;
I have a symbol drawing.I have to insert in plant drawing.while insert i have to change the layer name.how can i do this in vba.Herewith i enclosed symbol and plant drawing for reference.&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance.&lt;BR /&gt;
bharathi</description>
      <pubDate>Mon, 06 Aug 2007 09:34:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/layer-insert/m-p/2036928#M24013</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-08-06T09:34:05Z</dc:date>
    </item>
    <item>
      <title>Re: Layer Insert</title>
      <link>https://forums.autodesk.com/t5/vba-forum/layer-insert/m-p/2036929#M24014</link>
      <description>This worked for me in A2007:&lt;BR /&gt;
&lt;BR /&gt;
~'J'~&lt;BR /&gt;
[code]&lt;BR /&gt;
Option Explicit&lt;BR /&gt;
&lt;BR /&gt;
Sub InsertSymbol()&lt;BR /&gt;
     Dim fname As String&lt;BR /&gt;
     fname = ThisDrawing.Path &amp;amp; "\A9.dwg" '&amp;lt;--your symbol drawing name&lt;BR /&gt;
     Dim pt As Variant&lt;BR /&gt;
     Dim strPt As String&lt;BR /&gt;
     &lt;BR /&gt;
     With ThisDrawing&lt;BR /&gt;
     &lt;BR /&gt;
          pt = .Utility.GetPoint(, vbCr &amp;amp; "Pick an insertion point of block: ")&lt;BR /&gt;
&lt;BR /&gt;
          strPt = Replace(CStr(pt(0)), ",", ".") &amp;amp; "," &amp;amp; _&lt;BR /&gt;
                  Replace(CStr(pt(1)), ",", ".") &amp;amp; "," &amp;amp; _&lt;BR /&gt;
                  Replace(CStr(pt(2)), ",", ".")&lt;BR /&gt;
          .SetVariable "CLAYER", "INST" '&amp;lt;-- layer name you need&lt;BR /&gt;
          .SetVariable "CECOLOR", "BYLAYER" '&amp;lt;-- color bylayer&lt;BR /&gt;
          .SetVariable "EXPERT", 2 '&amp;lt;-- suppress any prompts&lt;BR /&gt;
          .SetVariable "FILEDIA", 0 '&amp;lt;-- suppress display file dialog box&lt;BR /&gt;
          .SendCommand ("._-insert " &amp;amp; Chr(34) &amp;amp; fname &amp;amp; Chr(34) &amp;amp; vbCr &amp;amp; strPt &amp;amp; vbCr &amp;amp; "1 1 0.0" &amp;amp; vbCr)&lt;BR /&gt;
          .SetVariable "FILEDIA", 1 '&amp;lt;-- restore variable&lt;BR /&gt;
          .SetVariable "EXPERT", 0 '&amp;lt;-- restore variable&lt;BR /&gt;
          &lt;BR /&gt;
      End With&lt;BR /&gt;
      &lt;BR /&gt;
     End Sub[/code]</description>
      <pubDate>Mon, 06 Aug 2007 10:05:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/layer-insert/m-p/2036929#M24014</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-08-06T10:05:28Z</dc:date>
    </item>
    <item>
      <title>Re: Layer Insert</title>
      <link>https://forums.autodesk.com/t5/vba-forum/layer-insert/m-p/2036930#M24015</link>
      <description>Hai,&lt;BR /&gt;
&lt;BR /&gt;
Thanks.But i need when i insert the symbol in plant drawing, i want to change the layer name....for ex...symbol drawing layer name is "INST".I need to change that Layer name from "INST" to "FLOOR1".whatever the symbol drawing layer, for ex, INST,DIM,BACK,0 like that...finally i insert in plant drawing i need to change layer name.&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance,&lt;BR /&gt;
Bharathi</description>
      <pubDate>Mon, 06 Aug 2007 23:54:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/layer-insert/m-p/2036930#M24015</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-08-06T23:54:46Z</dc:date>
    </item>
    <item>
      <title>Re: Layer Insert</title>
      <link>https://forums.autodesk.com/t5/vba-forum/layer-insert/m-p/2036931#M24016</link>
      <description>Sorry, Bharati&lt;BR /&gt;
Not clearly enough for me&lt;BR /&gt;
There are two ways:&lt;BR /&gt;
-you can rename layer&lt;BR /&gt;
-you can create the new one&lt;BR /&gt;
&lt;BR /&gt;
~'J'~</description>
      <pubDate>Tue, 07 Aug 2007 06:33:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/layer-insert/m-p/2036931#M24016</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-08-07T06:33:53Z</dc:date>
    </item>
    <item>
      <title>Re: Layer Insert</title>
      <link>https://forums.autodesk.com/t5/vba-forum/layer-insert/m-p/2036932#M24017</link>
      <description>Hai Fatty,&lt;BR /&gt;
&lt;BR /&gt;
yeah..I need to rename the layer...In symbol drawing, layer name is "INST".while insert into plant drawing i have to rename that layer into "Floor1".Herewith I attach some symbol drawing.In that symbols, drawing have CALL,INST layer...i have to rename that "Floor1".&lt;BR /&gt;
&lt;BR /&gt;
my target is...I have a plant drawing.i have to insert symbol in that, based on EL Value.&lt;BR /&gt;
&lt;BR /&gt;
for example :&lt;BR /&gt;
&lt;BR /&gt;
from 0 to 1000 is "Floor1" Layer&lt;BR /&gt;
1001 to 2000 is "Floor2" Layer&lt;BR /&gt;
&lt;BR /&gt;
El-100 'a1.dwg for ex: this symbol have "INST" layer. while insert into plant i have to change  "Floor1"&lt;BR /&gt;
El-200 'a3.dwg  &lt;BR /&gt;
El-1000 'd4.dwg&lt;BR /&gt;
&lt;BR /&gt;
El-2003 'c5.dwg  for ex: this symbol have "INST","CALL" layer. while insert into plant i have to change  "Floor2"&lt;BR /&gt;
El-2500 'f8.dwg&lt;BR /&gt;
&lt;BR /&gt;
Thank you so much,&lt;BR /&gt;
Bharathi</description>
      <pubDate>Tue, 07 Aug 2007 06:59:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/layer-insert/m-p/2036932#M24017</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-08-07T06:59:17Z</dc:date>
    </item>
    <item>
      <title>Re: Layer Insert</title>
      <link>https://forums.autodesk.com/t5/vba-forum/layer-insert/m-p/2036933#M24018</link>
      <description>Hai Fatty,&lt;BR /&gt;
&lt;BR /&gt;
In My Before Post I didnt attach drawing Files.Herewith i attach File.&lt;BR /&gt;
&lt;BR /&gt;
Thanks again,&lt;BR /&gt;
bharathi</description>
      <pubDate>Tue, 07 Aug 2007 07:03:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/layer-insert/m-p/2036933#M24018</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-08-07T07:03:05Z</dc:date>
    </item>
    <item>
      <title>Re: Layer Insert</title>
      <link>https://forums.autodesk.com/t5/vba-forum/layer-insert/m-p/2036934#M24019</link>
      <description>Hai Fatty,&lt;BR /&gt;
I think, i am Confusing you.sorry for poor explanation.here with i attach 2 symbol drawing. if you see this, you can get, what i need..I did this with the help of layer properties manager by manually.Same way i have to do in vba.&lt;BR /&gt;
&lt;BR /&gt;
1. before_rename_layer&lt;BR /&gt;
2. after_rename_layer&lt;BR /&gt;
&lt;BR /&gt;
1.before_rename_layer :&lt;BR /&gt;
	this drawing have Call, Inst Layer.&lt;BR /&gt;
2.after_rename_layer&lt;BR /&gt;
	I rename into Floor1 Layer.&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance,&lt;BR /&gt;
Bharathi</description>
      <pubDate>Tue, 07 Aug 2007 08:59:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/layer-insert/m-p/2036934#M24019</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-08-07T08:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: Layer Insert</title>
      <link>https://forums.autodesk.com/t5/vba-forum/layer-insert/m-p/2036935#M24020</link>
      <description>Hay, Bharati&lt;BR /&gt;
I'm still working on that&lt;BR /&gt;
Do not hurry me up, please, be patience&lt;BR /&gt;
This will be a long story, as you guess&lt;BR /&gt;
Say 1-2 days or so&lt;BR /&gt;
I can't to write quickly than I can&lt;BR /&gt;
&lt;BR /&gt;
~'J'~</description>
      <pubDate>Tue, 07 Aug 2007 09:54:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/layer-insert/m-p/2036935#M24020</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-08-07T09:54:08Z</dc:date>
    </item>
    <item>
      <title>Re: Layer Insert</title>
      <link>https://forums.autodesk.com/t5/vba-forum/layer-insert/m-p/2036936#M24021</link>
      <description>Hai Fatty,&lt;BR /&gt;
&lt;BR /&gt;
Thank you so much...I will wait...&lt;BR /&gt;
&lt;BR /&gt;
Thanks again,&lt;BR /&gt;
Bharathi</description>
      <pubDate>Tue, 07 Aug 2007 09:57:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/layer-insert/m-p/2036936#M24021</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-08-07T09:57:51Z</dc:date>
    </item>
    <item>
      <title>Re: Layer Insert</title>
      <link>https://forums.autodesk.com/t5/vba-forum/layer-insert/m-p/2036937#M24022</link>
      <description>Here is module code to rename layer in external drawing&lt;BR /&gt;
with help of ObjectDBX&lt;BR /&gt;
Keep in mind that it is not complete solution,&lt;BR /&gt;
it's just a framework only&lt;BR /&gt;
I don't include in this code check if this layer does exists:&lt;BR /&gt;
&lt;BR /&gt;
Option Explicit&lt;BR /&gt;
'&lt;BR /&gt;
'~ Request reference to AutoCAD/ObjectDBX Common 17.0 Type Library ~'&lt;BR /&gt;
'&lt;BR /&gt;
Function openDialog(sPath, sFilter)&lt;BR /&gt;
     Dim oCD, intResult&lt;BR /&gt;
     Set oCD = CreateObject("UserAccounts.CommonDialog")&lt;BR /&gt;
     oCD.Filter = sFilter&lt;BR /&gt;
     oCD.InitialDir = sPath&lt;BR /&gt;
     oCD.flags = &amp;amp;H80000 + &amp;amp;H4 + &amp;amp;H8 '//or 524300 summary&lt;BR /&gt;
     intResult = oCD.showOpen&lt;BR /&gt;
     openDialog = oCD.FileName&lt;BR /&gt;
End Function&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Sub ChangeSymbolLayer()&lt;BR /&gt;
&lt;BR /&gt;
Dim DwgName As String&lt;BR /&gt;
Dim objEnt As Object&lt;BR /&gt;
Dim oDbx As New AxDbDocument&lt;BR /&gt;
&lt;BR /&gt;
Set oDbx = GetInterfaceObject("ObjectDBX.AxDbDocument.17")     '' or 16 for A2005-6&lt;BR /&gt;
DwgName = openDialog(ThisDrawing.Path, "All Files|*.*|" _&lt;BR /&gt;
   &amp;amp; "AutoCAD Drawings and Templates|*.dwg;*.dwt")&lt;BR /&gt;
oDbx.Open DwgName&lt;BR /&gt;
&lt;BR /&gt;
On Error GoTo Err_Control&lt;BR /&gt;
For Each objEnt In oDbx.ModelSpace&lt;BR /&gt;
     objEnt.Layer = "Floor1"&lt;BR /&gt;
Next objEnt&lt;BR /&gt;
&lt;BR /&gt;
oDbx.SaveAs DwgName&lt;BR /&gt;
&lt;BR /&gt;
Set oDbx = Nothing&lt;BR /&gt;
Err_Control:&lt;BR /&gt;
MsgBox Err.Description&lt;BR /&gt;
&lt;BR /&gt;
End Sub&lt;BR /&gt;
'//==========================================//'&lt;BR /&gt;
&lt;BR /&gt;
Again, there is not clearly enough though, where you have&lt;BR /&gt;
a get EL values?&lt;BR /&gt;
What is the algorithm to set layer name accordingly&lt;BR /&gt;
to the symbol drawing name?&lt;BR /&gt;
e.g.&lt;BR /&gt;
&lt;BR /&gt;
Select Case dwgName&lt;BR /&gt;
Case "a1.dwg"&lt;BR /&gt;
layerName="Floor1"&lt;BR /&gt;
Case "a2.dwg"&lt;BR /&gt;
layerName="Floor2"&lt;BR /&gt;
Case "a3.dwg"&lt;BR /&gt;
layerName="Floor3"&lt;BR /&gt;
End select ???&lt;BR /&gt;
&lt;BR /&gt;
~'J'~</description>
      <pubDate>Tue, 07 Aug 2007 11:36:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/layer-insert/m-p/2036937#M24022</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-08-07T11:36:44Z</dc:date>
    </item>
    <item>
      <title>Re: Layer Insert</title>
      <link>https://forums.autodesk.com/t5/vba-forum/layer-insert/m-p/2036938#M24023</link>
      <description>Hai Fatty,&lt;BR /&gt;
&lt;BR /&gt;
Thanks Fatty.Herewith I enclosed excel sheet.Its a format of sql server table.i get the following values from the table (tag no,inst,x_position,y_position,z_position and symbol path).in z_pos Field have EL Values.i can seperate value &lt;BR /&gt;
&lt;BR /&gt;
from &lt;BR /&gt;
EL 102&lt;BR /&gt;
EL 103&lt;BR /&gt;
EL 2004&lt;BR /&gt;
&lt;BR /&gt;
to &lt;BR /&gt;
102&lt;BR /&gt;
103&lt;BR /&gt;
2004&lt;BR /&gt;
&lt;BR /&gt;
According to Inst, User can select the symbol drawing and save in sql server table.This code i finish.&lt;BR /&gt;
According to EL Value we have to set Layer name.&lt;BR /&gt;
&lt;BR /&gt;
Here i do one routine, take z_pos value &lt;BR /&gt;
from 0 to 2000  -- &amp;gt; "Floor1"&lt;BR /&gt;
from 2001 to 4000 ---&amp;gt; "Floor2"&lt;BR /&gt;
from 4001 to 6000 ---&amp;gt; "Floor3"&lt;BR /&gt;
from 6001 to 8000 ---&amp;gt; "Floor4"&lt;BR /&gt;
from 8001 to 10000 ---&amp;gt; "Floor5"&lt;BR /&gt;
from 10001 to 12000 ---&amp;gt; "Floor6"&lt;BR /&gt;
&lt;BR /&gt;
Like this rountine going on... &lt;BR /&gt;
&lt;BR /&gt;
according to this table for z_pos - EL 102....&lt;BR /&gt;
&lt;BR /&gt;
I take 102 and insert drawing --&amp;gt; C:\Base Drawing\d5.dwg and insert into plant drawing "Floor1" Layer. &lt;BR /&gt;
EL_10080 --- &amp;gt;C:\Base Drawing\h1.dwg ---&amp;gt; "Floor6" Layer&lt;BR /&gt;
&lt;BR /&gt;
Like this i have to insert...&lt;BR /&gt;
at this stage i have a problem, while inserting the symbol, the layer is different. for example "INST"...so i need to rename the layer name according to the table like "Floor1" or "Floor2"&lt;BR /&gt;
&lt;BR /&gt;
I dont know how to rename the layer...so i need your help.I think now you get.Applogies for my poor explanation.&lt;BR /&gt;
&lt;BR /&gt;
Thanks Again,&lt;BR /&gt;
Bharathi</description>
      <pubDate>Wed, 08 Aug 2007 01:49:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/layer-insert/m-p/2036938#M24023</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-08-08T01:49:46Z</dc:date>
    </item>
    <item>
      <title>Re: Layer Insert</title>
      <link>https://forums.autodesk.com/t5/vba-forum/layer-insert/m-p/2036939#M24024</link>
      <description>Hi Bharati&lt;BR /&gt;
How iot works:&lt;BR /&gt;
Open Plant_table.xls&lt;BR /&gt;
Select just one cell only in colun "E"&lt;BR /&gt;
Minimize Excel window, but do not close it&lt;BR /&gt;
Open drawing in which you want to insert&lt;BR /&gt;
external drawing as block&lt;BR /&gt;
Load project, then type vbarun&lt;BR /&gt;
After the Excel will be closed, jump to&lt;BR /&gt;
AutoCAD and see message&lt;BR /&gt;
Block should to be inserted in the position&lt;BR /&gt;
you got from Excel file &lt;BR /&gt;
Change references to your ACAD version&lt;BR /&gt;
&lt;BR /&gt;
Your VBA skill is enough to rewrite it&lt;BR /&gt;
to your needs, I'll busy and could not&lt;BR /&gt;
helps you further&lt;BR /&gt;
&lt;BR /&gt;
~'J'~</description>
      <pubDate>Wed, 08 Aug 2007 08:05:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/layer-insert/m-p/2036939#M24024</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-08-08T08:05:14Z</dc:date>
    </item>
    <item>
      <title>Re: Layer Insert</title>
      <link>https://forums.autodesk.com/t5/vba-forum/layer-insert/m-p/2036940#M24025</link>
      <description>Hai Fatty,&lt;BR /&gt;
&lt;BR /&gt;
Thank you so much....What I expect, I get from the your code.....With the help of your code i will finish...Thanks Again...&lt;BR /&gt;
&lt;BR /&gt;
Cheers,&lt;BR /&gt;
Bharathi</description>
      <pubDate>Thu, 09 Aug 2007 00:30:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/layer-insert/m-p/2036940#M24025</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-08-09T00:30:21Z</dc:date>
    </item>
  </channel>
</rss>

