Jump to content

Search the Community

Showing results for tags 'calculation'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • CADTutor
    • News, Announcements & FAQ
    • Feedback
  • AutoCAD
    • AutoCAD Beginners' Area
    • AutoCAD 2D Drafting, Object Properties & Interface
    • AutoCAD Drawing Management & Output
    • AutoCAD 3D Modelling & Rendering
    • AutoCAD Vertical Products
    • AutoCAD LT
    • CAD Management
    • AutoCAD Bugs, Error Messages & Quirks
    • AutoCAD General
    • AutoCAD Blogs
  • AutoCAD Customization
    • The CUI, Hatches, Linetypes, Scripts & Macros
    • AutoLISP, Visual LISP & DCL
    • .NET, ObjectARX & VBA
    • Application Beta Testing
    • Application Archive
  • Other Autodesk Products
    • Autodesk 3ds Max
    • Autodesk Revit
    • Autodesk Inventor
    • Autodesk Software General
  • Other CAD Products
    • BricsCAD
    • SketchUp
    • Rhino
    • SolidWorks
    • MicroStation
    • Design Software
    • Catch All
  • Resources
    • Tutorials & Tips'n'Tricks
    • AutoCAD Museum
    • Blocks, Images, Models & Materials
    • Useful Links
  • Community
    • Introduce Yourself
    • Showcase
    • Work In Progress
    • Jobs & Training
    • Chat
    • Competitions

Categories

  • Programs and Scripts
  • 2D AutoCAD Blocks
  • 3D AutoCAD Blocks
  • Images
    • Backgrounds

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Found 3 results

  1. Our surveyors have asked me to create a calculation interface. I wanted to create a lisp program with an interface where the surveyors could input their measurements. They typically measure the ground level of a sewer pit and then the depth of the sewer pipes. To get the level of the sewer pipes, they subtract the ground level from their measurements. However, I have some difficulties getting the interface to function. I came across code by Lee Mac and attempted to build upon it. My code is half in Dutch, 'MV' stands for Ground Level. I've attached a screenshot of my current progress. The issue is that the second calculation isn't being displayed. I would also want my outputs to have 2 decimals. lisp code: (defun c:test ( / *error* dch dcl des mv wid diepte) (defun *error* ( msg ) (if (and (= 'int (type dch)) (< 0 dch)) (unload_dialog dch) ) (if (= 'file (type des)) (close des) ) (if (and (= 'str (type dcl)) (findfile dcl)) (vl-file-delete dcl) ) (if (and msg (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*"))) (princ (strcat "\nError: " msg)) ) (princ) ) (cond ( (not (setq dcl (vl-filename-mktemp nil nil ".dcl") des (open dcl "w") ) ) (princ "\nUnable to open DCL for writing.") ) ( (progn (foreach str '( "ed : edit_box" "{" " alignment = left;" " width = 20;" " edit_width = 10;" " fixed_width = true;" "}" "" "test : dialog" "{" " spacer;" " key = \"dcl\";" " : ed" " {" " key = \"mv\";" " label = \"MV:\";" " }" " : ed" " {" " key = \"wid\";" " label = \"Width:\";" " }" " : ed" " {" " key = \"diepte\";" " label = \"A:\";" " }" " : row" " {" " : ed { key = \"res\"; label = \"BOK:\"; is_enabled = false; }" " : ed { key = \"res2\"; label = \"BOK2:\"; is_enabled = false; }" " : button" " {" " key = \"cal\";" " label = \"Calculate\";" " }" " }" " spacer;" " ok_only;" "}" ) (write-line str des) ) (setq des (close des) dch (load_dialog dcl) ) (<= dch 0) ) (princ "\nUnable to load DCL file.") ) ( (not (new_dialog "test" dch)) (princ "\nUnable to display 'test' dialog.") ) ( t (set_tile "dcl" "Calculate Area") (action_tile "mv" "(setq mv $value)") (action_tile "wid" "(setq wid $value)") (action_tile "diepte" "(setq diepte $value)") (action_tile "cal" (vl-prin1-to-string '( (lambda ( / x y z) (set_tile "res" "") (set_tile "res2" "") (cond ( (or (not mv) (= "" mv)) (alert "Please enter a maaiveld value.") (mode_tile "mv" 2) ) ( (or (not wid) (= "" wid)) (alert "Please enter a width value.") (mode_tile "wid" 2) ) ( (or (not diepte) (= "" diepte)) (alert "Please enter a a value.") (mode_tile "diepte" 2) ) ( (not (setq x (distof mv))) (alert "Het Maaiveld moet een getal zijn.") (mode_tile "mv" 2) ) ( (not (setq y (distof wid))) (alert "The width must be numerical.") (mode_tile "wid" 2) ) ( (not (setq z (distof diepte))) (alert "The diepte must be numerical.") (mode_tile "diepte" 2) ) ( (<= x 0.0) (alert "Het maaiveld moet groter dan nul zijn.") (mode_tile "mv" 2) ) ( (<= y 0.0) (alert "The width must be greater than zero.") (mode_tile "wid" 2) ) ( (<= z 0.0) (alert "The width must be greater than zero.") (mode_tile "diepte" 2) ) ( (set_tile "res" (rtos (- x y) 2))) ( (set_tile "res2" (rtos (- x z) 2))) ) ) ) ) ) (start_dialog) ) ) (*error* nil) (princ) ) If I manage to fix this then I will try to make a leader with the outputs.
  2. Hi everybody, I am converting some excel formulas to Visual Lisp. I found a difference between results of a same follwing formula: (I changed cells to numbers to simplify the problem.) in Excel: =0.6*2400*1.15*1170*1.1/100000 ---> result: 21.31272 In AutoLISP: (/(* 0.6 2400.0 1.15 1170.0 1.1) 100000.0) ---> result: 21.3127 While AutoLISP isn't as correct as Excel. Any help to get a result like Excel is appreciated.
  3. Hi All, I need some help here. I'v been using a autolisp (obtained from a friend) to calculate floor area with AutoCAD 2007. However recently I've upgraded my AutoCAD to 2013 and I realised the lisp coudn't function completely. I've attached the lisp file here, really hope someone can help to rectify so that it works for AutoCAD 2013. Fyi I knows nothing about writting lisp code... many thanks in advance! (not sure why this code looks so massive compared to others..) To share with those who may be interested, this lisp allows you to select multiple polylines (eg. floor area), followed by select those polylines representing regions to be subtracted (eg. void area), it will help you tabulate all the polyline parcels (floor areas subtract floor void) with end result and with labels for each parcel. Enjoy! ATAB.lsp
×
×
  • Create New...