<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
<title>Get Attributes</title>
<link>http://www.zwsoft.com/forum/viewthread.php?tid=1766</link>
<description>The problem happened because we have made a change on the return type of GetAttribute method, you can refer to Help menu -&gt; Developer Help -&gt; VBA Reference -&gt; Code Examples -&gt; GetAttribute Example section to see the difference.
 
And we suggest you modify your code to :
 
Public Sub NowGo()
Dim blockobj As ZwcadBlockReference
Dim ArrayAtribs As &lt;strong&gt;Variant&lt;/strong&gt;
Dim disegno As ZwcadDocument
    nometemplate = &quot;C:'Pubblica'Sergio'abc.dwt&quot; 
    Set disegno = ZwCAD.Documents.Add(nometemplate)
    For Each blockobj In disegno.ModelSpace
        If blockobj.HasAttributes = True Then
            &lt;strong&gt;ArrayAtribs = blockobj.GetAttributes  
&lt;/strong&gt;        End If
    Next
End Sub
</description>
<author>zw_admin</author>
<pubDate>2011-04-06 20:50:10</pubDate>
<item><link>http://www.zwsoft.com/forum/viewthread.php?tid=1766&amp;pid=13751</link>
<description>Hi rjbuljubasic

here is my solution for a similar problem  :this routine check the drawings for 3d polylines (you can convert to other poly however) and write one text file for each poly with  start and end point.




**
*** GENERAL DECLARATIONS *****
Public filenote
Const DEFAULT_PATH=&quot;&quot; '********** write your  path here
*** END GENERAL DECLARATIONS *****
Public Sub WRITE_POINTS()
Dim mia_poly As Zwcad3DPolyline
    For Each entobj In ThisDocument.ModelSpace 
        If entobj.EntityType = 2 Then  '3DPOLY
            Set mia_poly = entobj
            Call sub_txt_punti(mia_poly)
        End If
    Next
    Set mia_poly = Nothing
End Sub
Private Sub sub_txt_punti(pol As Zwcad3DPolyline)
    Dim a As Byte, lay As String, filenotename As String
    Dim plineObj As ZwcadPolyline
    Static inc As Integer
    lay = pol.Layer
    inc = inc + 1
    filenotename = DEFAULT_PATH &amp;amp; &quot;'&quot; &amp;amp; lay &amp;amp; &quot;_&quot; &amp;amp; inc &amp;amp; &quot;.txt&quot;
    Call crea_report(filenotename)
    
    For a = 0 To UBound(pol.Coordinates) Step 3
        note = Round(pol.Coordinates(a)) &amp;amp; &quot;; &quot; &amp;amp; Round(pol.Coordinates(a + 1)) &amp;amp; &quot;; &quot; &amp;amp; Round(pol.Coordinates(a + 2))
        
        filenote.writeline (note)
    Next a
    
    note = &quot;&quot;
    filenote.writeline (note)
    note = &quot;#&quot; &amp;amp; pol.Layer
    filenote.writeline (note)
    filenote.Close
    Set filenote = Nothing
    Dim mostra
    mostra = Shell(&quot;C:'Windows'system32'notepad.exe &quot; &amp;amp; filenotename, vbNormalFocus)
    Set mostra = Nothing
End Sub
Private Sub crea_report(nome_file As String)
    Set fs = CreateObject(&quot;Scripting.FileSystemObject&quot;)
    Set filenote = fs.CreateTextFile(nome_file, True)
End Sub
</description>
<author>zw_admin</author>
<pubDate>2011-08-23 03:12:10</pubDate>
</item><item><link>http://www.zwsoft.com/forum/viewthread.php?tid=1766&amp;pid=13500</link>
<description>
 
One night without sleep but I found the trick.
 

I've already done one database and then I've added one field for &quot;insertpoint(0)&quot; proprety that hold the &quot;X&quot; coordinate of the block.
When I launch the macro it reads all the block inside the drawing for to build the BOM (and now it records also the block's position).
So I can select the blocks in the right order building one query with &quot;... order by insertpoint(0) &quot;  and retrieve the  blocks with &quot; move first ,while not eof ,move next .. wend&quot; routine.
It works.</description>
<author>zw_admin</author>
<pubDate>2011-05-04 06:57:14</pubDate>
</item><item><link>http://www.zwsoft.com/forum/viewthread.php?tid=1766&amp;pid=13494</link>
<description>&lt;SPAN style=&quot;FONT-FAMILY: 'Verdana','sans-serif'; COLOR: black; FONT-SIZE: 5.5pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN-US; mso-fareast-: IT&quot; lang=EN-US&gt;
&lt;P style=&quot;LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt&quot; =Ms&#111;normal&gt;&lt;SPAN style=&quot;FONT-FAMILY: 'Verdana','sans-serif'; COLOR: black; FONT-SIZE: 8pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN-US; mso-fareast-: IT; mso-bidi-font-size: 5.5pt&quot; lang=EN-US&gt;Daniel please I need your help again. &lt;?:namespace prefix = o ns = &quot;urn:schemas-microsoft-com:office:office&quot; /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;
 

&lt;P style=&quot;LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt&quot; =Ms&#111;normal&gt;&lt;SPAN style=&quot;FONT-FAMILY: 'Verdana','sans-serif'; COLOR: black; FONT-SIZE: 8pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN-US; mso-fareast-: IT; mso-bidi-font-size: 5.5pt&quot; lang=EN-US&gt;Could you explain me which is the way that ZW use for to go through the several blocks inside the drawing? &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;
 

&lt;P style=&quot;LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt&quot; =Ms&#111;normal&gt;&lt;SPAN style=&quot;FONT-FAMILY: 'Verdana','sans-serif'; COLOR: black; FONT-SIZE: 8pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN-US; mso-fareast-: IT; mso-bidi-font-size: 5.5pt&quot; lang=EN-US&gt;I try to explain better what I need: I use one routine that collect the attributes from various blocks inside my drawing and put some values in the BOM .Now I need to take the blocks in the same order that they are drawn in the dwg, from left to right.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;
 

&lt;P style=&quot;LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt&quot; =Ms&#111;normal&gt;&lt;SPAN style=&quot;FONT-FAMILY: 'Verdana','sans-serif'; COLOR: black; FONT-SIZE: 8pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN-US; mso-fareast-: IT; mso-bidi-font-size: 5.5pt&quot; lang=EN-US&gt;Is it possible to set some vales in the block that learn to ZW to process the block in some order?&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;
 

&lt;P style=&quot;LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt&quot; =Ms&#111;normal&gt;&lt;SPAN style=&quot;FONT-FAMILY: 'Verdana','sans-serif'; COLOR: black; FONT-SIZE: 8pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN-US; mso-fareast-: IT; mso-bidi-font-size: 5.5pt&quot; lang=EN-US&gt;Is necessary to add one more attribute &quot;PROCESS_ORDER&quot; at the blocks and set the value as I need? &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;
 

&lt;P style=&quot;LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt&quot; =Ms&#111;normal&gt;&lt;SPAN style=&quot;FONT-FAMILY: 'Verdana','sans-serif'; COLOR: black; FONT-SIZE: 8pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-: IT; mso-bidi-font-size: 5.5pt&quot;&gt;Thanks a lot.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;
 

&lt;P style=&quot;LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt&quot; =Ms&#111;normal&gt;&lt;SPAN style=&quot;FONT-FAMILY: 'Verdana','sans-serif'; COLOR: black; FONT-SIZE: 8pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-: IT; mso-bidi-font-size: 5.5pt&quot;&gt;Sergio&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;
 

&lt;P style=&quot;LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt&quot; =Ms&#111;normal&gt;&lt;/SPAN&gt;
 
</description>
<author>zw_admin</author>
<pubDate>2011-04-29 04:12:35</pubDate>
</item><item><link>http://www.zwsoft.com/forum/viewthread.php?tid=1766&amp;pid=13451</link>
<description>Perfect Daniel ,I'm sorry but I  missed the help reference,you've done a really good job.
I changed the way to go trough the attributes from
//code
For s = 0 To attributes.count-1
.......
 
next s
 
//end code
 
in
 
//code

For s = 0 To Ubound(attributes)
 
.....
 
next s
 
//end code
 
Thanks again.
sergio
 </description>
<author>zw_admin</author>
<pubDate>2011-04-07 02:14:44</pubDate>
</item><item><link>http://www.zwsoft.com/forum/viewthread.php?tid=1766&amp;pid=13445</link>
<description>Hi all.
I use this code for to extract attributes from blocks with ZW2010 but it doesn't work with 2011 , I get 426 error.
Please help me.
Thanks.
Best regards.
Sergio
 
//code
 
Public Sub NowGo()
Dim blockobj As ZwcadBlockReference
Dim ArrayAtribs As ZwcadAttributeReferences
Dim disegno As ZwcadDocument
    nometemplate = &quot;C:'Pubblica'Sergio'abc.dwt&quot; 'TEMPLATE WITH ONE BLOCK WITH MANY ATTRIBUTES
    Set disegno = ZwCAD.Documents.Add(nometemplate)
    For Each blockobj In disegno.ModelSpace
        If blockobj.HasAttributes = True Then
            Set ArrayAtribs = blockobj.GetAttributes  'GET &quot;ERROR 424 OBJECT REQUIRED&quot; BUT THIS CODE WORKS WELL WITH ZW 2010
        End If
    Next
End Sub
 //end code
 </description>
<author>zw_admin</author>
<pubDate>2011-04-06 07:38:38</pubDate>
</item>  </channel>
</rss>