<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
<title>Block -XScaleFactor,YScaleFactor (VBA)</title>
<link>http://www.zwsoft.com/forum/viewthread.php?tid=1754</link>
<description>
 
From the code, it seems that there is problem in REGEN mechanism in ZWCAD. Anyway, try to add this line to the end: 
 
&lt;strong&gt;ThisDocument.Regen zcAllViewports&lt;/strong&gt;</description>
<author>magla</author>
<pubDate>2011-03-23 00:53:57</pubDate>
<item><link>http://www.zwsoft.com/forum/viewthread.php?tid=1754&amp;pid=13505</link>
<description>I encountered this many times. the undo comes in a batch. why is it happening?? I already done so many lines and text by just making use of undo once one batch of what i've done is lost. so I need to repeat again what I already did. A waste of time especially in a rush.</description>
<author>noys</author>
<pubDate>2011-05-11 04:19:39</pubDate>
</item><item><link>http://www.zwsoft.com/forum/viewthread.php?tid=1754&amp;pid=13416</link>
<description>
 
Thanks
 
</description>
<author>magla</author>
<pubDate>2011-03-29 14:57:32</pubDate>
</item><item><link>http://www.zwsoft.com/forum/viewthread.php?tid=1754&amp;pid=13407</link>
<description>
[QUOTE=magla]Jason,
 
after :
Command: c:sel
 
Always get -Nothing sleectedo
 
What I'm doing wrong?
 
this one will be more user frindly
&lt;font color=&quot;#990000&quot; face=&quot;Courier New, Courier, mono&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;(defun c:SEL (/ OB OB# EN X Y)
  (vl-load-com)
  (if (setq OB (entsel &quot;'nSelect block to change XY scale: &quot;))
    (if (= (cdr (assoc 0 (entget (setq EN (car OB))))) &quot;INSERT&quot;)
      (if (not (kr:BLK_CheckIfXref (setq OB# (vlax-ename-&gt;vla-object EN))))
        (if (vlax-write-enabled-p OB#)
          (if
            (and
              (setq X (getreal &quot;'nEnter X scale factor: &quot;))
              (setq y (getreal &quot;'nEnter Y scale factor: &quot;))
            )
            (progn
              (kr:SYS_StartUndo)
              (if (vlax-Property-Available-P OB# 'XEffectiveScaleFactor)
                (progn
                  (vla-put-XEffectiveScaleFactor OB# X)
                  (vla-put-YEffectiveScaleFactor OB# Y)
                )
                (progn
                  (vla-put-XScaleFactor OB# X)
                  (vla-put-YScaleFactor OB# Y)
                )
              )
              (kr:SYS_EndUndo)
            )
            (princ &quot;'n** Invalid input **&quot;)
          )
          (princ &quot;'n** Object on locked layer **&quot;)
        )
        (princ (strcat &quot;'n** Caution! '&quot;&quot; (kr:BLK_GetBlockName OB#) &quot;'&quot; is an externally referenced block **&quot;))
      )
      (princ &quot;'n** Selected item not an INSERT ** &quot;)
    )
    (princ &quot;'n** Nothing selected **&quot;)
  )
  (princ)
)&lt;/font&gt;
&lt;font color=&quot;#006600&quot;&gt;; ============================================================ ;
; Retrieves pointers to the active document                    ;
; ============================================================ ;&lt;/font&gt;
&lt;font color=&quot;#000000&quot;&gt;(defun kr:ACX_ADoc ()
  (or
    *kr-ADoc
    (setq *kr-ADoc (vla-Get-ActiveDocument (vlax-Get-Acad-Object)))
  )
  *kr-ADoc
)&lt;/font&gt;
&lt;font color=&quot;#006600&quot;&gt;; ============================================================ ;
; Check if selected block as an XREF                           ;
;   Blk - VLA block reference object                           ;
; ============================================================ ;&lt;/font&gt;
&lt;font color=&quot;#000000&quot;&gt;(defun kr:BLK_CheckIfXref (Blk)
  (eq
    (vla-Get-IsXref
      (vla-Item
        (vla-Get-Blocks (kr:ACX_ADoc))
        (vla-Get-Name Blk)
      )
    )
    :vlax-true
  )
)&lt;/font&gt;
&lt;font color=&quot;#006600&quot;&gt;; ============================================================ ;
; Get block name                                               ;
;   Blk - VLA block reference object                           ;
; ============================================================ ;&lt;/font&gt;
&lt;font color=&quot;#000000&quot;&gt;(defun kr:BLK_GetBlockName (Blk)
  (if (vlax-Property-Available-P Blk 'EffectiveName)
    (vla-Get-EffectiveName Blk)
    (vla-Get-Name Blk)
  )
)&lt;/font&gt;
&lt;font color=&quot;#006600&quot;&gt;; ============================================================ ;
; Start undo mark                                              ;
; ============================================================ ;&lt;/font&gt;
&lt;font color=&quot;#000000&quot;&gt;(defun kr:SYS_StartUndo ()
  (vla-StartUndoMark (kr:ACX_ADoc))
)&lt;/font&gt;
&lt;font color=&quot;#006600&quot;&gt;; ============================================================ ;
; End undo mark                                                ;
; ============================================================ ;&lt;/font&gt;
&lt;font color=&quot;#000000&quot;&gt;(defun kr:SYS_EndUndo ()
  (vla-EndUndoMark (kr:ACX_ADoc))
)

(princ)&lt;/font&gt;&lt;/font&gt;
</description>
<author>zw_admin</author>
<pubDate>2011-03-28 02:11:20</pubDate>
</item><item><link>http://www.zwsoft.com/forum/viewthread.php?tid=1754&amp;pid=13398</link>
<description>Jason,
 
after :
Command: c:sel
 
Always get -Nothing sleectedo
 
What I'm doing wrong?
 </description>
<author>magla</author>
<pubDate>2011-03-25 19:28:42</pubDate>
</item><item><link>http://www.zwsoft.com/forum/viewthread.php?tid=1754&amp;pid=13397</link>
<description>
[QUOTE=magla]Yes, LISP will be OK
&lt;code&gt;(defun c:SEL (/ SS O#)
  (vl-load-com)
  (if (setq SS (ssget &quot;_X&quot; '((0 . &quot;INSERT&quot;)(2 . &quot;&lt;font color=&quot;#009900&quot;&gt;blockname&lt;/font&gt;&quot;))))
    (foreach % (jk:SSX_SS-&gt;List SS)
      (if (vlax-write-enabled-p (setq O# (vlax-ename-&gt;vla-object %)))
        (progn
          (vla-StartUndoMark (vla-get-activedocument (vlax-get-acad-object)))
          (vla-put-XScaleFactor O# 2) &lt;font color=&quot;#009900&quot;&gt;;;; scale X&lt;/font&gt;
          (vla-put-YScaleFactor O# 2)&lt;font color=&quot;#009900&quot;&gt; ;;; scale Y&lt;/font&gt;
          (vla-put-ZScaleFactor O# 2) &lt;font color=&quot;#009900&quot;&gt;;;; scale Z&lt;/font&gt;
          (vla-EndUndoMark (vla-get-activedocument (vlax-get-acad-object)))
        )
      )
    )
    (princ &quot;'n** Nothing sleectedo. **&quot;)
  )
  (princ)
)
&lt;font color=&quot;#009933&quot;&gt;; ============================================================ ;
; Convert selection set to list of ENAME                       ;
; ============================================================ ;&lt;/font&gt;
(defun jk:SSX_SS-&gt;List (sel / n l)
  (repeat 
    (setq n (sslength sel))
    (setq n (1- n) 
          l (cons (ssname sel n) l)
    )
  )
)&lt;/code&gt;
</description>
<author>zw_admin</author>
<pubDate>2011-03-24 12:04:23</pubDate>
</item><item><link>http://www.zwsoft.com/forum/viewthread.php?tid=1754&amp;pid=13396</link>
<description>Yes, LISP will be OK</description>
<author>magla</author>
<pubDate>2011-03-23 19:55:23</pubDate>
</item><item><link>http://www.zwsoft.com/forum/viewthread.php?tid=1754&amp;pid=13395</link>
<description>
[QUOTE=magla]&lt;p style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;&lt;span style=&quot;font-family: 'Verdana','sans-serif'; color: black; font-size: 9pt;&quot;&gt;&lt;v:shape id=&quot;_x0000_t75&quot; stroked=&quot;f&quot; filled=&quot;f&quot; path=&quot;m@4@5l@4@11@9@11@9@5xe&quot; o:preferrelative=&quot;t&quot; o:spt=&quot;75&quot; coordsize=&quot;21600,21600&quot;&gt;&lt;v:stroke joinstyle=&quot;miter&quot;&gt;&lt;/v:stroke&gt;&lt;v:ulas&gt;&lt;v:f eqn=&quot;if lineDrawn pixelLineWidth 0&quot;&gt;&lt;/v:f&gt;&lt;v:f eqn=&quot;sum @0 1 0&quot;&gt;&lt;/v:f&gt;&lt;v:f eqn=&quot;sum 0 0 @1&quot;&gt;&lt;/v:f&gt;&lt;v:f eqn=&quot;prod @2 1 2&quot;&gt;&lt;/v:f&gt;&lt;v:f eqn=&quot;prod @3 21600 pixelWidth&quot;&gt;&lt;/v:f&gt;&lt;v:f eqn=&quot;prod @3 21600 pixelHeight&quot;&gt;&lt;/v:f&gt;&lt;v:f eqn=&quot;sum @0 0 1&quot;&gt;&lt;/v:f&gt;&lt;v:f eqn=&quot;prod @6 1 2&quot;&gt;&lt;/v:f&gt;&lt;v:f eqn=&quot;prod @7 21600 pixelWidth&quot;&gt;&lt;/v:f&gt;&lt;v:f eqn=&quot;sum @8 21600 0&quot;&gt;&lt;/v:f&gt;&lt;v:f eqn=&quot;prod @7 21600 pixelHeight&quot;&gt;&lt;/v:f&gt;&lt;v:f eqn=&quot;sum @10 21600 0&quot;&gt;&lt;/v:f&gt;&lt;/v:ulas&gt;&lt;v:path o:c&#111;nnect=&quot;rect&quot; gradientshapeok=&quot;t&quot; o:extrusi&#111;nok=&quot;f&quot;&gt;&lt;/v:path&gt;&lt;o:lock aspectratio=&quot;t&quot; v:ext=&quot;edit&quot;&gt;&lt;/o:lock&gt;&lt;/v:shape&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 'Verdana','sans-serif'; color: black; font-size: 9pt;&quot; lang=&quot;EN&quot;&gt;Thanks Daniel,but &lt;img src=&quot;http://classic.zwcad.org/Forum/smileys/smiley19.gif&quot; height=&quot;17&quot; width=&quot;17&quot; border=&quot;0&quot; align=&quot;absmiddle&quot; alt=&quot;Cry&quot; /&gt; &lt;/span&gt;
 

Unfortunately, zero points. &lt;o:p&gt;&lt;/o:p&gt;
&lt;p style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;&lt;span style=&quot;font-family: 'Verdana','sans-serif'; color: black; font-size: 9pt;&quot; lang=&quot;EN&quot;&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;
 

&lt;p style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;&lt;span style=&quot;font-family: 'Verdana','sans-serif'; color: black; font-size: 9pt;&quot; lang=&quot;EN&quot;&gt;It works only with block without attributes.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;
 

&lt;p style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;&lt;span style=&quot;font-family: 'Verdana','sans-serif'; color: black; font-size: 9pt;&quot; lang=&quot;EN&quot;&gt;If I have block only with attributes there will be no changes at all For block (graphic + attribute) it will change only graphic.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;
 

&lt;p style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;&lt;span style=&quot;font-family: 'Verdana','sans-serif'; color: black; font-size: 9pt;&quot; lang=&quot;EN&quot;&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;
 

&lt;p style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;&lt;span style=&quot;font-family: 'Verdana','sans-serif'; color: black; font-size: 9pt;&quot; lang=&quot;EN&quot;&gt;How to change size of text in block attribute ?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;
 

are you interesting with lisp solution ?
j.
</description>
<author>zw_admin</author>
<pubDate>2011-03-23 12:00:56</pubDate>
</item><item><link>http://www.zwsoft.com/forum/viewthread.php?tid=1754&amp;pid=13394</link>
<description>&lt;P style=&quot;MARGIN: 0cm 0cm 0pt&quot; =Ms&#111;normal&gt;&lt;SPAN style=&quot;FONT-FAMILY: 'Verdana','sans-serif'; COLOR: black; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-: HR; mso-no-proof: yes&quot;&gt;&lt;?:namespace prefix = v ns = &quot;urn:schemas-microsoft-com:vml&quot; /&gt;&lt;v:shape id=_x0000_t75 stroked=&quot;f&quot; filled=&quot;f&quot; path=&quot;m@4@5l@4@11@9@11@9@5xe&quot; o:preferrelative=&quot;t&quot; o:spt=&quot;75&quot; coordsize=&quot;21600,21600&quot;&gt;&lt;v:stroke joinstyle=&quot;miter&quot;&gt;&lt;/v:stroke&gt;&lt;v:ulas&gt;&lt;v:f eqn=&quot;if lineDrawn pixelLineWidth 0&quot;&gt;&lt;/v:f&gt;&lt;v:f eqn=&quot;sum @0 1 0&quot;&gt;&lt;/v:f&gt;&lt;v:f eqn=&quot;sum 0 0 @1&quot;&gt;&lt;/v:f&gt;&lt;v:f eqn=&quot;prod @2 1 2&quot;&gt;&lt;/v:f&gt;&lt;v:f eqn=&quot;prod @3 21600 pixelWidth&quot;&gt;&lt;/v:f&gt;&lt;v:f eqn=&quot;prod @3 21600 pixelHeight&quot;&gt;&lt;/v:f&gt;&lt;v:f eqn=&quot;sum @0 0 1&quot;&gt;&lt;/v:f&gt;&lt;v:f eqn=&quot;prod @6 1 2&quot;&gt;&lt;/v:f&gt;&lt;v:f eqn=&quot;prod @7 21600 pixelWidth&quot;&gt;&lt;/v:f&gt;&lt;v:f eqn=&quot;sum @8 21600 0&quot;&gt;&lt;/v:f&gt;&lt;v:f eqn=&quot;prod @7 21600 pixelHeight&quot;&gt;&lt;/v:f&gt;&lt;v:f eqn=&quot;sum @10 21600 0&quot;&gt;&lt;/v:f&gt;&lt;/v:ulas&gt;&lt;v:path o:c&#111;nnect=&quot;rect&quot; gradientshapeok=&quot;t&quot; o:extrusi&#111;nok=&quot;f&quot;&gt;&lt;/v:path&gt;&lt;?:namespace prefix = o ns = &quot;urn:schemas-microsoft-com:office:office&quot; /&gt;&lt;o:lock aspectratio=&quot;t&quot; v:ext=&quot;edit&quot;&gt;&lt;/o:lock&gt;&lt;/v:shape&gt;&lt;/SPAN&gt;&lt;SPAN style=&quot;FONT-FAMILY: 'Verdana','sans-serif'; COLOR: black; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-: HR; mso-ansi-: EN&quot; lang=EN&gt;Thanks Daniel,but &lt;img src=&quot;http://classic.zwcad.org/Forum/smileys/smiley19.gif&quot; height=&quot;17&quot; width=&quot;17&quot; border=&quot;0&quot; align=&quot;absmiddle&quot; alt=&quot;Cry&quot; /&gt; 
 

Unfortunately, zero points. &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;
&lt;P style=&quot;MARGIN: 0cm 0cm 0pt&quot; =Ms&#111;normal&gt;&lt;SPAN style=&quot;FONT-FAMILY: 'Verdana','sans-serif'; COLOR: black; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-: HR; mso-ansi-: EN&quot; lang=EN&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;
 

&lt;P style=&quot;MARGIN: 0cm 0cm 0pt&quot; =Ms&#111;normal&gt;&lt;SPAN style=&quot;FONT-FAMILY: 'Verdana','sans-serif'; COLOR: black; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-: HR; mso-ansi-: EN&quot; lang=EN&gt;It works only with block without attributes.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;
 

&lt;P style=&quot;MARGIN: 0cm 0cm 0pt&quot; =Ms&#111;normal&gt;&lt;SPAN style=&quot;FONT-FAMILY: 'Verdana','sans-serif'; COLOR: black; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-: HR; mso-ansi-: EN&quot; lang=EN&gt;If I have block only with attributes there will be no changes at all For block (graphic + attribute) it will change only graphic.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;
 

&lt;P style=&quot;MARGIN: 0cm 0cm 0pt&quot; =Ms&#111;normal&gt;&lt;SPAN style=&quot;FONT-FAMILY: 'Verdana','sans-serif'; COLOR: black; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-: HR; mso-ansi-: EN&quot; lang=EN&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;
 

&lt;P style=&quot;MARGIN: 0cm 0cm 0pt&quot; =Ms&#111;normal&gt;&lt;SPAN style=&quot;FONT-FAMILY: 'Verdana','sans-serif'; COLOR: black; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-: HR; mso-ansi-: EN&quot; lang=EN&gt;How to change size of text in block attribute ?&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;
 
</description>
<author>magla</author>
<pubDate>2011-03-23 05:08:48</pubDate>
</item><item><link>http://www.zwsoft.com/forum/viewthread.php?tid=1754&amp;pid=13388</link>
<description>Hi,
 
I try to change size of specific block through command XScaleFactor,YScaleFactor.
 
Code (ZWCAD 2011,VBA):
Private Sub cdOK_Click()
        Dim EntObj As ZwcadEntity
        Dim blockObj As ZwcadBlockReference
        Dim X, Y As Double
                         For Each EntObj In ThisDocument.ModelSpace
                            With EntObj
                                If EntObj.EntityType = zcBlockInsert Then
                                           Set blockObj = EntObj
                                            If blockObj.Name = StartBlok Then
                                                      X = 1                                                 
                                                      Y = 1
                                                     blockObj.XScaleFactor = X
                                                     blockObj.YScaleFactor = Y
                                                     blockObj.Update
                                           End If
                               End If
                            End With
                        Next EntObj
                 Debug.Print &quot;==&gt;KRAJ OK&quot;
            End Sub
 

&lt;P style=&quot;MARGIN: 0cm 0cm 0pt&quot; =Ms&#111;normal&gt;&lt;SPAN style=&quot;FONT-FAMILY: 'Verdana','sans-serif'; COLOR: black; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-: HR&quot; lang=EN-US&gt;Results is that specific block (StartBlok) has XScaleFactor and YScaleFactor as I want (in this case X=1,Y=1)on drawing checking by Properties. &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;MARGIN: 0cm 0cm 0pt&quot; =Ms&#111;normal&gt;&lt;SPAN style=&quot;FONT-FAMILY: 'Verdana','sans-serif'; COLOR: black; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-: HR&quot; lang=EN-US&gt;Problem is that size of that block is not change. It is only changed when I manually do that (Change properties -Parameter YscaleFactor.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;
 

 
It is possible to change XScaleFactor and YScaleFactor of block thorough VBA with effect ?
 
Regards,
 
MaGla
 </description>
<author>magla</author>
<pubDate>2011-03-22 05:02:54</pubDate>
</item>  </channel>
</rss>