Print Page | Close Window

LISP

Printed From: CAD Forum
Category: EN
Forum Name: AutoCAD
Forum Description: Discussion about AutoCAD and AutoCAD LT, viewers, DWG and DWF formats, Design Review, AutoCAD 360, add-ons
URL: https://www.cadforum.cz/forum_en/forum_posts.asp?TID=14364
Printed Date: 13.Jul.2025 at 06:46


Topic: LISP
Posted By: sdzitko
Subject: LISP
Date Posted: 06.Jul.2024 at 14:08
Atarting to use or learn Lisp.

Presently I want to be able to do following.

  1. Click on point
  2. Enter 4 vaules of a steel structure.
    1. Orig. Thickness
    2. Present thickness
    3. Max Allowable % wastage/reduction i.e, 25%
    4. 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?



Replies:
Posted By: Vladimir Michl
Date Posted: 07.Jul.2024 at 08:34
Your input is quite vague. What to do with the clicked point? What should be drawn?

(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)
)


-------------
Vladimir Michl (moderator)
ARKANCE - https://arkance.world" rel="nofollow - https://arkance.world - Autodesk Platinum Partner


Posted By: sdzitko
Date Posted: 08.Jul.2024 at 15:05
uploads/865185/USNS_Soderman_04_dk.pdf" rel="nofollow - uploads/865185/USNS_Soderman_04_dk.pdf

See attached.  I hope this shows what final drawing might look like.

Arrows and numbers are shown.  Red and Green showing bad thickness readings.


Posted By: Kent Cooper
Date Posted: 08.Jul.2024 at 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?


Posted By: sdzitko
Date Posted: 08.Jul.2024 at 20:01
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%)


Posted By: sdzitko
Date Posted: 11.Jul.2024 at 01:32
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.



Print Page | Close Window