Display full version of the post: LISP
Atarting to use or learn Lisp.Presently I want to be able to do following.Click on pointEnter 4 vaules of a steel structure.Orig. ThicknessPresent thicknessMax Allowable % wastage/reduction i.e, 25%Drawing result to look like this for 1" orig Plate showing present thickness and wastage calculation - .75"(.25"). Highlight %wastage as follows- red when 25% wastage and orange when 18.75% wastage.Anyone able to assist in writing this code?
Vladimir Michl
07.07.2024, 08:34
Your input is quite vague. What to do with the clicked point? What should be drawn?[CODE](defun C:STEELSTRUC ( / pt oth pth pct) (setq pt (getpoint "\nClick a point: ")) (setq oth (getdist "\nSpecify orig. thickness: ")) (setq pth (getdist "\nSpecify present thickness: ")) (setq pct (getdist "\nSpecify percentage - reduction: "));now perform drawing and calculations, the hardest part...;e.g.: (command "_LINE" pt (list (+ (car pt) oth) (cadr pt)) "") (princ))[/CODE]
uploads/865185/USNS_Soderman_04_dk.pdfSee attached. I hope this shows what final drawing might look like.Arrows and numbers are shown. Red and Green showing bad thickness readings.
Kent Cooper
08.07.2024, 18:28
Should red and orange in the first description (item 2. sub-item 4.) be red and green instead? (Or should green things in the image be orange instead?)How/where does the description's item 1. "Click on point" relate to the drawing?
Kent Cooper2024-07-08 18:30:06
Should red and orange in the first description (item 2. sub-item 4.) be red and green instead? (Or should green things in the image be orange instead?)How/where does the description's item 1. "Click on point" relate to the drawing?We use Red and Yellow actually. And would like to stay that way.When I say "Click on Point" I mean insert reading and % wastage at that location. I.e .233"(27%)
Do you think a MACRO can make this work?Like this -- "ask for Orig, ask for present measurement, click on drwing to insert following in right location then continue same with all other locations the. double click to end inserting": measurement" (meas./orig*100)% i.e .750"(75%) i.e. .818"(81%)Where original is 1". Always calculated % -- 0% to 75% is red, 76% to 81% is green, % greater then 82% black.