Jump to content

Search the Community

Showing results for tags 'create panel lisp'.

  • 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 1 result

  1. Hi All, I was trying to write a lisp program to create Panels in a given rectangular area. Program would ask user to provide the Width and Height of the rectangular area. Then it asks for Panel Width and Panel Height. Then it will prompt for the bottom left corner of the rectangular area. Done... But something is holding me back. The loop doesn't end and it keeps creating the first column only. What could be wrong? Here is the code (defun c:pn () (setq Width (getdist "\nWidth of area to be filled : "));Getting the total Width of the area to fill (setq Height (getdist "\nHeight of area to be filled : "));Getting the total Height of the area to fill (setq PanelWidth (getdist "\nWidth of the panel : "));Getting Width of the panel (setq PanelHeight (getdist "\nHeight of the panel : "));Getting Height of the panel (setq XNumberOfPanels (fix (/ Width PanelWidth)));Calculating Number of panels in X Direction (setq YNumberOfPanels (fix (/ Height PanelHeight)));Calculating Number of panels in Y Direction (setq Gap (/(- Width (* XNumberOfPanels PanelWidth)) (+ XNumberOfPanels 1)));Calculating Gap between the panels (setq Pnt (getpoint "\nPick the Bottom Left Corner of the area to be filled : "));Getting the insertion Point (setq YPnt Pnt) (setq x 0);Counter for X Direction (setq y 0);Counter for Y Direction (setq COSMode (getvar 'OSMODE));Storing the value of Current OSMode (setvar 'OSMODE 0);Switching Off all Object snaps (setq Pnt (List (+ (car Pnt) Gap) (+ (cadr Pnt) Gap)));Computing the starting point of the first Rectangle, which is away by one Gap distance along X and one Gap distance along Y (while (<= x XNumberOfPanels) (while (<= y YNumberOfPanels) (setq Pnt1 (list (car Pnt) (+ (cadr pnt) Gap))) (setq Pnt2 (Polar Pnt1 (rad 90) PanelHeight)) (setq Pnt3 (Polar Pnt2 (rad 0) PanelWidth)) (setq Pnt4 (Polar Pnt3 (rad 270) PanelHeight)) (command "PLine" Pnt1 Pnt2 Pnt3 Pnt4 "Close") (setq Pnt Pnt2) ;(alert (strcat "x is " (itoa x))) (setq x (+ x 1)) );Ending While Loop for Y Direction (setq Pnt (list (+ (car YPnt) Gap (* PanelWidth y)) (+ (cadr YPnt) Gap))) (set y (+ y 1)) );Ending While Loop for X Direction (setvar 'OSMODE COSMode);Setting OSMode back to initial value (princ);Silent ending ) ;Function to convert Degrees to Radians (defun rad (Ang) (* 0.01745329 Ang) )
×
×
  • Create New...