Jump to content

Hi all, everyone can help me make a lisp about scale one direction. Detail for below.


Trai

Recommended Posts

Outside of LISP, I saw something similar which was to make the objects into a block, the block can be scaled by axis, then explode the block. Might be able to do something similar with a LISP?

  • Like 1
  • Agree 1
Link to comment
Share on other sites

42 minutes ago, Steven P said:

Outside of LISP, I saw something similar which was to make the objects into a block, the block can be scaled by axis, then explode the block. Might be able to do something similar with a LISP?

I know how to do it, but i don't want to convert to block then explode,  in addition when  you convert to block , it only import factor scale that can not reference as scale command. Using a lisp tool will saving time.

Link to comment
Share on other sites

I've never seen anything but references like blocks and xrefs with different properties for x & y scale or seen it done in a lisp. 

Block could be purged in the lisp after exploding.

I've often used this in older versions that would convert polylines into line segments I'd half to rejoin but in current versions polylines return as polylines.

Seems like a no-brainer.

  • Like 1
Link to comment
Share on other sites

7 minutes ago, tombu said:

I've never seen anything but references like blocks and xrefs with different properties for x & y scale or seen it done in a lisp. 

Block could be purged in the lisp after exploding.

I've often used this in older versions that would convert polylines into line segments I'd half to rejoin but in current versions polylines return as polylines.

Seems like a no-brainer.

image.png.93a9355df7d89b4344c02d9f47b349a9.png i want to it as below image

Link to comment
Share on other sites

3 minutes ago, Trai said:

image.png.93a9355df7d89b4344c02d9f47b349a9.png i want to it as below image

What happened to the x & y options you asked for? 

Why not use the Scale command or grip menu?

Link to comment
Share on other sites

1 minute ago, tombu said:

What happened to the x & y options you asked for? 

Why not use the Scale command or grip menu?

i want to scale only one direction because in autocad only scale x, y axis together

Link to comment
Share on other sites

this is code for reference:


(DEFUN EXCUTE()
  (setq oldvalue (getvar "CMDECHO"))
  (setvar "CMDECHO" 0)
  (princ "select object: ")
  (setq ss (ssget))
  (setq P0 (getpoint "\nSelect base point: "))
  (initget 1 "X Y X S")
  (setq C (getkword "\nSelect axis [X,Y,Z,Scale]?<X/Y/Z/S> :"))
  (setq hs (getreal "import scale factor: "))
  (DELBLOCK "vkc_temp")
  (CREATEBLOCK ss P0)  
  (Command "-Insert" "vkc_temp" C hs P0 "")  
  (setq dt (entlast))
  (Command "Explode" dt)
  (setvar "CMDECHO" oldvalue)
  (princ)
)
(DEFUN CREATEBLOCK(ss P)
  (command "-Block" "vkc_temp" P ss "")
)

(DEFUN DELBLOCK (bname)
  (if (IsExistBlock bname)
    (Command "-Purge" "B" bname "Y" "Y")    
  )
)
(DEFUN IsExistBlock(bname / kq)
  (setq kq Nil)
  (setq n (length LiBlk))
  (setq i 0)
  (while (< i n)
    (if (= bname (nth i LiBlk))
      (progn
    (setq i n)
    (setq kq T)
      )    
    )
    (setq i (1+ i))
  )
  kq
)
(DEFUN CREALIBLK (/ NL)
  (setq LiBlk (List))
  (setq NL (tblnext "BLOCK" T))  
  (while NL    
    (setq LiBlk (append LiBlk (list (cdr (assoc 2 NL)))))
    (setq NL (tblnext "BLOCK"))
  )
  (setq LiBlk (Acad_strlsort LiBlk))
)
(DEFUN C:XSCALE()
  (CREALIBLK)
  (EXCUTE)
)
(DEFUN C:SC1()
  (CREALIBLK)
  (EXCUTE)
)
 

Everyone can  add this feature for meimage.png.04a8667f3e423916b2a6a980291d3e8f.png.to replace asking "" import fator scale ""  

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...