Jump to content

Search the Community

Showing results for tags 'return_value'.

  • 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 2 results

  1. Hi, I want to check for the width and height of a Rectangle. I got this code (defun getRect () (if (setq rec (ssget "_X" (list '(0 . "LWPOLYLINE") '(8 . "LAYOUT") '(90 . 4) (cons 410 (getvar "ctab")) ))) (progn (setq e (ssname rec 0)) (setq coords (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget e)))) (setq height (distance (car coords) (nth 3 coords))) (setq width (distance (car coords) (nth 1 coords))) (if (= height 594.0) T (princ height) ) ) ) (princ) ) If I check for the Width it works and it returns T But If I try to get the height it returns false and prints 594.0 Why does this not return True as well?
  2. Hi everyone, Just trying to pass a list of points to a "pline" command. The problem is num of points is initially unknown, though being calculated within a routine. The following code (as smth to start with) evolves known num of points. (defun c:pltest6 () (setq pts (list '(0 0) '(0 10) '(10 10) '(10 20) '(20 20) '(20 30) '(30 30))) (setq ptqty 7) (setq ptnum 0) (command "pline" (car pts) (pt_retr pts) (pt_retr pts) (pt_retr pts) (pt_retr pts) (pt_retr pts) (pt_retr pts) "" ) ) (defun pt_retr (lst) (setq ptnum (1+ ptnum)) (repeat ptnum (setq lst (cdr lst)) ) (setq pt (car lst)) ) Repeat/foreach don't do, 'cause they return the value of the last iteration.. Now my Q is, is it possible to modify the code above to use loop instead of repeat one and the same line (moreover, unknown number of times ), OR some other approach would rather fix the task? Thank you in advance, Dmitro
×
×
  • Create New...