Jump to content

Recommended Posts

Posted

I want to scale the program lisp block XY and Z differently not only one scale

ie x - 3 y-5 z -1

  • Replies 23
  • Created
  • Last Reply

Top Posters In This Topic

  • plecs

    15

  • Tharwat

    7

  • ReMark

    1

  • steven-g

    1

Posted

Thank you very much,

 

but I want to insert a particular block and how do we scale this XYZ

Posted

but I want to insert a particular block and how do we scale this XYZ

 

Replace your block name as shown in the following codes .

 

(command "_.-insert" "[color=magenta]BlockName[/color]" "_none" pause "xyz" 3. 5. 1. "0")

Posted

You don't necessarily need lisp to do that. The INSERT command brings up a dialog box with an option to set a non-uniform scale for X, Y and Z or any combination of the three.

Posted

yes a need a lisp to do that because a want to insert multiple bloc with different scale x y z to make a cabinet

Posted

but I have another problem I do not know how to make multiple insertion point insertion point

Posted
but I have another problem I do not know how to make multiple insertion point insertion point

Post here the list of insertion points with a list of block names ( or maybe one block name for that list ) .

Posted (edited)

give the following lisp and do not know on

(defun c:cp1m ()
;imput
(setq ipt (getpoint"\nSelect the bottom left point <X Y Z>: ")) ; ipt 0.0 0.0 0.0
(setq lun (getreal "\nLength ofcabinet < L>:")); 800
(setq adc (getreal "\nDepth of cabinet < AD >: "));320
(setq hinal (getreal "\nHeight cabinet < H >: "));750
(setq nrc (getreal "\nNumber of cabinet < NR >: ")); 1
(setq thc (getreal "\nThickness of cabinet < G_PAL >: "));18
 	(setq gpfl (getreal "\nThickness of PFL< G_PFL >: "));4
 	  (command "_.-insert" "BlockName" "_none" pause "xyz" 3. 5. 1. "0") ; 750.0 18.0 320.0
(command "_.-insert" "BlockName" "_none" pause "xyz" 3. 5. 1. "0"); 764.0 18.0 320.0
(command "_.-insert" "BlockName" "_none" pause "xyz" 3. 5. 1. "0"); 750.0 18. 0 320.0
(command "_.-insert" "BlockName" "_none" pause "xyz" 3. 5. 1. "0") ; 764.0 18.0 320.0
(command "_.-insert" "BlockName" "_none" pause "xyz" 3. 5. 1. "0") 782.0 732.0 4.0 
(princ)
)

Edited by plecs
Posted

but I can not handle the insertion point and either insert block

Posted
but I can not handle the insertion point and either insert block

What is the Block name that you want to insert ?

Posted

I'll put what I want to do the program DWG lisp and how I want to be at the end

Posted

Post a sample drawing of your block showing final presentation of it .

Posted

code to be something like this

(defun c:cp1m ()
;imput
(setq ipt (getpoint"\nSelect the bottom left point <X Y Z>: ")) ; ipt 0.0 0.0 0.0
(setq lun (getreal "\nLength ofcabinet < L>:")); 800
(setq adc (getreal "\nDepth of cabinet < AD >: "));320
(setq hinal (getreal "\nHeight cabinet < H >: "));750
(setq nrc (getreal "\nNumber of cabinet < NR >: ")); 1
(setq thc (getreal "\nThickness of cabinet < G_PAL >: "));18
 	(setq gpfl (getreal "\nThickness of PFL< G_PFL >: "));4
 	  (command "_.-insert" "BlockName" "_none" pause "xyz" 3. 5. 1. "0") ;650.0 320.0 18.0
(command "_.-insert" "BlockName" "_none" pause "xyz" 3. 5. 1. "0"); 764.0  320.0 18.0
(command "_.-insert" "BlockName" "_none" pause "xyz" 3. 5. 1. "0"); 650.0 320.0 18.0
(command "_.-insert" "BlockName" "_none" pause "xyz" 3. 5. 1. "0") ; 764.0  320.0 18.0
(command "_.-insert" "BlockName" "_none" pause "xyz" 3. 5. 1. "0") 782.0 632.0 4.0 
(princ)
)

cabinet.dwg

Posted

All things are mixed up with each other , and I don't know how you would insert them as long as you have them in different insertion points !

Besides that , these blocks are attributed .

 

I think you should look for another way of creating and inserting your blocks .

Posted

After I read cite are several ways to do this.

but do not know how to put them into operation,

One. block thirst after which it (ssget last insert) then (xyz scale and rotation) then compet attributes. (but do not know how to make me what that document as ssget last imput block)

Two. created block with these features but this is more complicated and is parameterized from my point of view would be the done me good because I can not allow to edit whenever I want to change the cabinet

Posted

That is why I ask and someone else can help me and me

Posted

I miss the following codes IPT 1 2 3 4 and do not know how to manipulate list could do insert point where I should be

This is the box but I want to block attrib I need to export them to me. xls

 

can you understand me now

(defun c:test1 (/ u L AD H NR G_PAL G_PFL)
;imput
(setvar "Cmdecho" 0)
(setq ipt (getpoint"\nSelect the bottom left point <X Y Z>: "))
(setq lun (getreal "\nLength ofcabinet < L>:"))
(setq adc (getreal "\nDepth of cabinet < AD >: "))
(setq hinal (getreal "\nHeight cabinet < H >: "))
(setq nrc (getreal "\nNumber of cabinet < NR >: "))
(setq thc (getreal "\nThickness of cabinet < G_PAL >: "))
 	(setq gpfl (getreal "\nThickness of PFL< G_PFL >: "))
 	(progn
  (setq lun1 (- lun (* thc 2))))
 	(setq lun_pfl (- lun thc))
 	(setq lat_pfl (- hinal thc))
(command "_.box" "_non" ipt  "L" thc  hinal adc)
 	(setq ipt1 (getpoint"\nSelect the bottom left point <X Y Z>: "))
(command "_.box" "_non" ipt1  "L" lun1  thc adc)
 	(setq ipt2 (getpoint"\nSelect the bottom left point <X Y Z>: "))
(command "_.box" "_non" ipt2  "L" thc  hinal adc)
 	(setq ipt3 (getpoint"\nSelect the bottom left point <X Y Z>: "))
(command "_.box" "_non" ipt3  "L" lun1  thc adc)
 	(setq ipt4 (getpoint"\nSelect the bottom left point <X Y Z>: "))
 	(command "_.box" "_non" ipt4  "L" lun_pfl  lat_pfl gpfl)
(setvar "Cmdecho" 1)
(princ)
)
(defun c:test2 (/ u L AD H NR G_PAL G_PFL)
;imput
(setvar "Cmdecho" 0)
(setq ipt (getpoint"\nSelect the bottom left point <X Y Z>: "))
(setq lun (getreal "\nLength ofcabinet < L>:"))
(setq adc (getreal "\nDepth of cabinet < AD >: "))
(setq hinal (getreal "\nHeight cabinet < H >: "))
(setq nrc (getreal "\nNumber of cabinet < NR >: "))
(setq thc (getreal "\nThickness of cabinet < G_PAL >: "))
 	(setq gpfl (getreal "\nThickness of PFL< G_PFL >: "))
 	(progn
  (setq lun1 (- lun (* thc 2))))
 	(setq lun_pfl (- lun thc))
 	(setq lat_pfl (- hinal thc))
(command "_.box" "_non" ipt  "L" thc  hinal adc)
 	(command "_.box" "_non" ipt1  "L" lun1  thc adc)
 	(command "_.box" "_non" ipt2  "L" thc  hinal adc)
 	(command "_.box" "_non" ipt3  "L" lun1  thc adc)
 	(command "_.box" "_non" ipt4  "L" lun_pfl  lat_pfl gpfl)
(setvar "Cmdecho" 1)
(princ)
)

Posted

I imagine if you are including attributes into your blocks that you are also using excel so that you can extract the attribute information, if this is true then my advice would be forget the attributes and approach this differently. Draw this in excel with formulas finding your insertion point for you, it is much easier to do it this way.

If you are not using excel then I would suggest not spending time worrying about multiple insertion points, stick to one point and just adjust where you are inserting the block.

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...