Command polar array

Command polar array

Anonymous
Not applicable
1,297 Views
7 Replies
Message 1 of 8

Command polar array

Anonymous
Not applicable

Hello,

 

It might be a dumb question for you but I have some troubles with this

 

So. I have to do this  draw with that command and I dont know how to write it

 

Attached you have what I've done and the screenshot of entire draw. The only thing that I dont know is that pollar array comand. Can you help me please?

0 Likes
1,298 Views
7 Replies
Replies (7)
Message 2 of 8

Anonymous
Not applicable

Edit: sorry for uploading a bad image with the codes, here is the right one

 

; adaptare valori variabile de sistem
(setq cmdc (getvar "cmdecho")
attd (getvar "attdia")
osmd (getvar "osmode"))
(setvar "cmdecho" 0)
(setvar "attdia" 1)
(setvar "osmode" 0)
; introducere date de intrare
(initget 1 )
(setq p1 (getpoint "\nIndica punctul de insertie: "))
(initget 3)
(setq L (getreal "\nIntrodu valoarea lungimii minim 100 (mm): "))
(initget 3)
(setq H (getreal "\nIntrodu valoarea lungimii minim 100 (mm): "))

;definire puncte caracteristice desen
(setq p2 (list (+ (car p1) L) (+ (cadr p1) H))
p3 (list (+ (car p1) 1.6 (* 0.06 L)) (+ (cadr p1) 1.6 (* 0.053 H)))
p4 (list (+ (car p1) (* 0.2 L)) (+ (cadr p1) (* 0.344 H)))
p5 (list (+ (car p1) (* 0.3 L)) (+ (cadr p1) (* 0.52 H)))
p6 (list (+ (car p1) (* 0.08 L)) (+ (cadr p1) (* 0.8 H)))
p7 (list (+ (car p1) 2.5 (* 0.6 L)) (+ (cadr p1) 2.5(* 0.85 H)))
p8 (list (+ (car p1) (* 0.72 L)) (+ (cadr p1) (* 0.12 H)))
p9 (list (+ (car p1) (* 0.6 L)) (+ (cadr p1) (* 0.595 H)))
)


;desenare piesa
(command "rectangle" p1 p2
"circle" p3 1.6
"-array" "L" "" "R" "1" "5" (* 0.048 H)
"rectangle" p4 "D" "60" "10" p2
"arc" p6 "e" (list (+ (car p6) 20) (cadr p6 )) "A" "-180"
"arc" p8 "e" (list (+ (car p8) 20) (cadr p8)) "A" "-180"
"line"p6 (list (+(car p6) 20) (cadr p6))""
"line"p8 (list (+(car p8) 20) (cadr p8))""
"polygon" "4" p7 "C" "2.5"
"-array" "L" "" "P" "1" "5" (* 0.85) "180" "Y"
"line" p5 "@0,10" "@10,0" "@0,-2.5" "@20,0" ""
"line" p5 "@10,0" "@0,2.5" "@20,0" ""
"arc" p9 "e" (list (car p9) (- (cadr p9) 5)) "A" "-180") ""

0 Likes
Message 3 of 8

Anonymous
Not applicable

Sorry for the wrong image "drawning"

 

Here is the code of what ive done and in the first post you have the image with the pollar array draw that in need to do it

 

; adaptare valori variabile de sistem
(setq cmdc (getvar "cmdecho")
attd (getvar "attdia")
osmd (getvar "osmode"))
(setvar "cmdecho" 0)
(setvar "attdia" 1)
(setvar "osmode" 0)
; introducere date de intrare
(initget 1 )
(setq p1 (getpoint "\nIndica punctul de insertie: "))
(initget 3)
(setq L (getreal "\nIntrodu valoarea lungimii minim 100 (mm): "))
(initget 3)
(setq H (getreal "\nIntrodu valoarea lungimii minim 100 (mm): "))

;definire puncte caracteristice desen
(setq p2 (list (+ (car p1) L) (+ (cadr p1) H))
p3 (list (+ (car p1) 1.6 (* 0.06 L)) (+ (cadr p1) 1.6 (* 0.053 H)))
p4 (list (+ (car p1) (* 0.2 L)) (+ (cadr p1) (* 0.344 H)))
p5 (list (+ (car p1) (* 0.3 L)) (+ (cadr p1) (* 0.52 H)))
p6 (list (+ (car p1) (* 0.08 L)) (+ (cadr p1) (* 0.8 H)))
p7 (list (+ (car p1) 2.5 (* 0.6 L)) (+ (cadr p1) 2.5(* 0.85 H)))
p8 (list (+ (car p1) (* 0.72 L)) (+ (cadr p1) (* 0.12 H)))
p9 (list (+ (car p1) (* 0.6 L)) (+ (cadr p1) (* 0.595 H)))
)


;desenare piesa
(command "rectangle" p1 p2
"circle" p3 1.6
"-array" "L" "" "R" "1" "5" (* 0.048 H)
"rectangle" p4 "D" "60" "10" p2
"arc" p6 "e" (list (+ (car p6) 20) (cadr p6 )) "A" "-180"
"arc" p8 "e" (list (+ (car p8) 20) (cadr p8)) "A" "-180"
"line"p6 (list (+(car p6) 20) (cadr p6))""
"line"p8 (list (+(car p8) 20) (cadr p8))""
"polygon" "4" p7 "C" "2.5"
"-array" "L" "" "P" "1" "5" (* 0.85) "180" "Y"
"line" p5 "@0,10" "@10,0" "@0,-2.5" "@20,0" ""
"line" p5 "@10,0" "@0,2.5" "@20,0" ""
"arc" p9 "e" (list (car p9) (- (cadr p9) 5)) "A" "-180") ""

0 Likes
Message 4 of 8

devitg
Advisor
Advisor
Command: _arrayrect
Select objects: *Cancel*
Command: *Cancel*
Command: _arraypolar
Select objects: *Cancel*

 

Did you try it, ?

0 Likes
Message 5 of 8

Kent1Cooper
Consultant
Consultant

Either ARRAYPOLAR or ARRAY and its POlar option, and follow the prompts [read about it in Help if you don't understand what a prompt is asking for].  If you're talking about the six squares in your image [the only thing that looks like a polar array to me], be sure to use the ROTate option and answer "No."

Kent Cooper, AIA
0 Likes
Message 6 of 8

Anonymous
Not applicable

Sorry but I didnt understand. I tried to write it but doesnt work. Im noob, is my first time when I try to do something in lisp. Is a project for the college and i dont understand anything. I had a model and i adapted from there what ive done untill now. But that pollar array of the squares is not there. The only thing i know is that it should be like first array of the circles. 

 

Has to be something like "array" "L" "P" ""   but after that i dont know what to write, the order

 

If you look to the image you will see the distance of 0,4L of width and 0,15H of height. There is the squere that i will use for the pollar array, There is the starting point. Maybe it will help you this information

 

 

Sorry but i cant figured out

0 Likes
Message 7 of 8

Sea-Haven
Mentor
Mentor

Get some things called pencil and paper, type -Array write down everything you answer to make it work. Enter about correct values for spacing/angles  etc.

 

In the lisp code you can substitute values by lisp eg (* ht 2.0) 

0 Likes
Message 8 of 8

Kent1Cooper
Consultant
Consultant

Somewhere in this Array command [any polar Array]:

 

"-array" "L" "" "P" "1" "5" (* 0.85) "180" "Y"

 

there will need to be a point  given for the center of the array.  As already advised, do it manually and write down the sequence of answers to prompts.

 

Unfortunately, the image does not contain enough information to determine that center point.  It ties down the positions of only two of the squares.  I think you could probably find the centers of those two, project Lines from them at 330- and 210-degree angles, and use their intersection as the center point.  That's not difficult manually, but to encode it into AutoLisp seems pretty far above the intended level of this exercise.  I would ask your teacher for more information about the position of a center point, or something.

Kent Cooper, AIA
0 Likes