Jump to content

Search the Community

Showing results for tags 'bounding box'.

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

  1. Hi all, I am attempting to get a viewport from blocks in modelspace to paperspace with a layout template. I would like this automated by selecting all the blocks in numerical order and placing them on the correct numbered layout. I have found plenty of lisp out there, but nothing that seems to work 100%. I know there are programs out there, but I want to try to learn autolisp with this project. I think I was able to get close with these two: Draw bounding box on object-from Blackbox Create multiple viewport from multiple rectangle in model space-from hmsilva The main difference I want to change below is to select all of my objects, instead of being prompted to select a single object, (defun c:BNDBX (/ eName mn mx) (vl-load-com) (if (setq eName (car (entsel "\n >> Select Object >> "))) (progn (vla-getboundingbox (vlax-ename->vla-object eName) 'mn 'mx) (vl-cmdf "._rectang" (vlax-safearray->list mn) (vlax-safearray->list mx)))) (princ) ) ) I have tried inserting (if (setq eName (ssget "_x" '((0 . "INSERT") (2 . "PageView")))) on the 3rd line with no success. Eventually I would like to have the second code produce layouts in order. But I figured I would get this chunk sorted first.
  2. I currently have a really really basic LISP routine. It was written to center a group of objects within a 12x9 drawing sheet (some people do not care whether their drawing is centered or not... pet peeve) ANYWAYS.. In a nutshell it prompts user to select objects using SSGET. Then asks the user for 2 points, which could be any two opposing points that encompass the outer most limits of the group of objects. After the SSGET and the 2 points have been established I have the routine moving the group based on center of 2 points to the center of the 12x9 drawing sheet. We draw in isometric hence the command snap "I" and "S". I had it snap to Standard so the beginner users can quickly move their cursor to the extents of any given group.. See Code below (DEFUN C:CEN (/ *ERROR* oldsnap oldos) (defun *error* (msg) (if oldos (setvar "osmode" oldos)) (if oldsnap (setvar "snapmode" oldsnap)) (if msg (prompt msg)) (princ) ) (setvar "cmdecho" 0) (setq oldsnap (getvar "snapmode") (setq oldos (getvar "osmode")) (princ "\nSelect Object(s) to CENTER within the titleblock. ") (SETQ CENT3R (SSGET )) (command "snap" "s" "s" "") (setvar "snapmode" 0) (SETQ P1 (GETpoint "\nFirst corner of rectangle: ")) (setvar "osmode" 0) (setq p2 (getCORNER P1 "\nSecond corner of rectangle: ")) (COMMAND "MOVE" CENT3R "" "m2p" p1 p2 "M2P" "0,0" "12,9") (command "snap" "s" "i" "") (setvar "snapmode" oldsnap) (setvar "OSMODE" OLDOS) (SETQ CENT3R NIL) (*ERROR* NIL) (PRINT) ) I would like to use BoundingBox function to Automatically get the coordinates of the SSGET, instead of asking user for First and Second points of rectangle. See Code below that gets bounding box coordinates. Can someone please help me bring these 2 together? Thanks and God bless. (defun c:test ( / OBJ Point1 Point2 ) (vl-load-com) (princ "\nSelect an object: ") (setq OBJ (vlax-ename->vla-object (ssname (ssget) 0))) (if OBJ (progn ;;OBJ is a vla-object ;;Point1 is the lower left point of the bounding box around the object ;;Point2 is the upper right point of the bounding box around the object (vla-getboundingbox OBJ 'Point1 'Point2) ;;Point1 and Point2 are returned as a safearray and need to be converted to a list (setq Point1 (vlax-safearray->list Point1)) (setq Point2 (vlax-safearray->list Point2)) (princ (strcat "\n The lower left corner is " (rtos (car Point1) 2 2) ", " (rtos (cadr Point1) 2 2))) (princ (strcat "\nThe upper right corner is " (rtos (car Point2) 2 2) ", " (rtos (cadr Point2) 2 2))) ) ) (princ) )
  3. Hi, I'm looking for an autolisp that can create a rectangular bounding box around a closed object i.e a region, a block of a profile, an open-closed polyline. Thank you in advanced, Nicolas.
  4. Hi, I am looking for a way to automatically draw a rectangular/square frame around a block (in this case, a block of a profile) and also set the base point in the middle of the profile block. I have to use xline together with rectangle to do this, then draw a diagonal and use the midpoint of the diagonal each time. It would be great to know if there is a way to automate the process. I do understand that I can find the diagonal of the frame using LIST yet i can see no way to apply this into the routine. Thank you very much. Regards, Nicolas.
×
×
  • Create New...