plecs Posted March 8, 2014 Posted March 8, 2014 I want to scale the program lisp block XY and Z differently not only one scale ie x - 3 y-5 z -1 Quote
plecs Posted March 9, 2014 Author Posted March 9, 2014 Thank you very much, but I want to insert a particular block and how do we scale this XYZ Quote
Tharwat Posted March 9, 2014 Posted March 9, 2014 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") Quote
ReMark Posted March 9, 2014 Posted March 9, 2014 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. Quote
plecs Posted March 9, 2014 Author Posted March 9, 2014 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 Quote
plecs Posted March 9, 2014 Author Posted March 9, 2014 but I have another problem I do not know how to make multiple insertion point insertion point Quote
Tharwat Posted March 9, 2014 Posted March 9, 2014 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 ) . Quote
plecs Posted March 9, 2014 Author Posted March 9, 2014 (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 March 9, 2014 by plecs Quote
plecs Posted March 9, 2014 Author Posted March 9, 2014 but I can not handle the insertion point and either insert block Quote
Tharwat Posted March 9, 2014 Posted March 9, 2014 but I can not handle the insertion point and either insert block What is the Block name that you want to insert ? Quote
plecs Posted March 9, 2014 Author Posted March 9, 2014 I'll put what I want to do the program DWG lisp and how I want to be at the end Quote
Tharwat Posted March 9, 2014 Posted March 9, 2014 Post a sample drawing of your block showing final presentation of it . Quote
plecs Posted March 9, 2014 Author Posted March 9, 2014 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 Quote
Tharwat Posted March 9, 2014 Posted March 9, 2014 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 . Quote
plecs Posted March 9, 2014 Author Posted March 9, 2014 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 Quote
plecs Posted March 9, 2014 Author Posted March 9, 2014 That is why I ask and someone else can help me and me Quote
plecs Posted March 9, 2014 Author Posted March 9, 2014 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) ) Quote
steven-g Posted March 9, 2014 Posted March 9, 2014 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. Quote
Recommended Posts
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.