CAD Forum - Database of tips, tricks and utilities for AutoCAD, Inventor and other Autodesk products [www.cadforum.cz]
CZ | EN | DE
Login or
registration
  Visitors: 7662
RSS channel - CAD tips RSS tips
RSS discussions

Discussion Discussion forum

 

HelpCAD discussion

 
CAD Forum - Homepage CAD discussion forum - ask any CAD-related questions here, share your CAD knowledge on AutoCAD, Inventor, Revit and other Autodesk software with your peers from all over the world. To start a new topic, choose an appropriate forum.

Please abide by the rules of this forum.

How to post questions: register or login, go to the specific forum and click the NEW TOPIC button.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

LISP

 Post Reply Post Reply
Author
sdzitko View Drop Down
Newbie
Newbie


Joined: 22.Dec.2020
Location: United States
Using: AutoCad
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote sdzitko Quote  Post ReplyReply Direct Link To This Post Topic: LISP
    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?
Back to Top
Vladimir Michl View Drop Down
Moderator Group
Moderator Group

Arkance Systems CZ

Joined: 26.Jul.2007
Location: Czech Republic
Using: Autodesk software
Status: Offline
Points: 2021
Post Options Post Options   Thanks (0) Thanks(0)   Quote Vladimir Michl Quote  Post ReplyReply Direct Link To This Post 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 - Autodesk Platinum Partner
Back to Top
sdzitko View Drop Down
Newbie
Newbie


Joined: 22.Dec.2020
Location: United States
Using: AutoCad
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote sdzitko Quote  Post ReplyReply Direct Link To This Post Posted: 08.Jul.2024 at 15:05

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

Arrows and numbers are shown.  Red and Green showing bad thickness readings.
Back to Top
Kent Cooper View Drop Down
Senior Member
Senior Member


Joined: 12.Mar.2013
Location: United States
Using: AutoCAD2020, 2023
Status: Offline
Points: 643
Post Options Post Options   Thanks (0) Thanks(0)   Quote Kent Cooper Quote  Post ReplyReply Direct Link To This Post 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?


Edited by Kent Cooper - 08.Jul.2024 at 18:30
Back to Top
sdzitko View Drop Down
Newbie
Newbie


Joined: 22.Dec.2020
Location: United States
Using: AutoCad
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote sdzitko Quote  Post ReplyReply Direct Link To This Post 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%)
Back to Top
sdzitko View Drop Down
Newbie
Newbie


Joined: 22.Dec.2020
Location: United States
Using: AutoCad
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote sdzitko Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top

Related CAD tips:


 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0,449 seconds.