Good morning group,
I am trying to write a LISP routine that will generate a rectangle based on the first input dimension always with the proportion of 1:1.618. If anyone can help I would certainly appreciate it.
|
Good morning group,
I am trying to write a LISP routine that will generate a rectangle based on the first input dimension always with the proportion of 1:1.618. If anyone can help I would certainly appreciate it.
Try this:
Code:(defun c:SREC ( / pt h) (princ "SPECIAL RECTANGLE ") (if (and (setq pt (getpoint "\nSpecify rectangle start point: ")) (setq h (getreal "\nEnter the rectangle length: "))) (command "._rectang" pt "_dimensions" (* 1.618 h) h pt) (prompt "\n** Invalid input ** ")) (princ))
"How we think determines what we do, and what we do determines what we get."
Sincpac C3D ~ Autodesk Exchange Apps
Computer Specs:
Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000
Renderman...worked perfectly..Thank you very much for the code....will certainly help in design process.
Cheers,
Richard
"How we think determines what we do, and what we do determines what we get."
Sincpac C3D ~ Autodesk Exchange Apps
Computer Specs:
Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000
You probably wanted golden number fi...
To be more precise :
M.R.Code:(defun c:GREC ( / pt h fi) (princ "GOLDEN RECTANGLE ") (if (and (setq pt (getpoint "\nSpecify rectangle start point: ")) (setq h (getdist pt "\nEnter the rectangle length: ")) (setq fi (/ (+ (sqrt 5) 1) 2))) (command "._rectang" pt "_dimensions" (* fi h) h pt) (prompt "\n** Invalid input ** ")) (princ))
"How we think determines what we do, and what we do determines what we get."
Sincpac C3D ~ Autodesk Exchange Apps
Computer Specs:
Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000
Gentlemen,
Yes, Golden Rectangle is what I was looking for. Did not know how to code it as I am only standing by the ocean of Visual Basic and watching the AutoLISP routines go by!
Thanks again to you both,
Richard