Jump to content

Search the Community

Showing results for tags 'lsip'.

  • 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. Hai all, i have a lisp that gives me Length and Width of Rectangles that i select into a Table in cad. the table gives me the length and width as per incremental in size (eg:{ 1x2, 1.2x2, 2.1x3 } like wise) i have attached a screenshot of this, and also joins same size rectangle in one cell and shows number as 2. What i need help is to get the table not as incremental values but as i select (1st selection in first cell, 2nd in second cell like that). Please check the Screen shot. i don't know how to change the codes, the lisp is from a friend i got. so please help if possible , thanks in advance.. Please check the image ive uploaded too. the lisp code: (defun rectangle_dims (e / l a b) (setq l (mapcar 'cdr (vl-remove-if '(lambda (x) (/= (car x) 10)) e))) (if (and (or (= 1 (logand (cdr (assoc 70 e)) 1)) (equal (car l) (last l) 1e-8) ) (equal (distance (car l) (caddr l)) (distance (cadr l) (cadddr l)) 1e-8) (equal (mapcar '- (cadr l) (car l)) (mapcar '- (caddr l) (cadddr l)) 1e-8) (equal (mapcar '- (caddr l) (cadr l)) (mapcar '- (cadddr l) (car l)) 1e-8) ) (vl-sort (list (distance (car l) (cadr l)) (distance (cadr l) (caddr l))) '<) ) ) (defun C:RECDIMS (/ acObj acDoc space *error* ss e old r p1) (vl-load-com) (setq acObj (vlax-get-acad-object) acDoc (vla-get-activedocument acObj) space (vlax-get acDoc (if (= 1 (getvar 'cvport)) 'PaperSpace 'ModelSpace)) ) (vla-startundomark acDoc) ;;;;;; Error function ;;;;;;;;; (defun *error* (msg) (and msg (not (wcmatch (strcase msg) "*CANCEL*,*QUIT*,*BREAK*")) (princ (strcat "\nError: " msg)) ) (vla-endundomark acDoc) (princ) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (if (setq ss (ssget '((0 . "LWPOLYLINE") (-4 . "<OR") (90 . 4) (90 . 5) (-4 . "OR>")))) (progn (repeat (setq i (sslength ss)) (setq e (ssname ss (setq i (1- i)))) (if (setq dims (rectangle_dims (entget e))) (if (setq old (vl-some '(lambda (d) (if (equal (list (cadr d) (caddr d)) dims 1e-8) d)) r)) (setq r (subst (cons (1+ (car old)) dims) old r)) (setq r (cons (cons 1 dims) r)) ) ) ) (if (and r (setq p1 (getpoint "\nSpecify table insert point: "))) (insert_table (mapcar '(lambda (a) (list (cadr a) (caddr a) (car a)) ) (vl-sort (vl-sort r '(lambda (a b) (< (caddr a) (caddr b)))) '(lambda (a b) (< (cadr a) (cadr b)))) ) p1 ) ) ) ) (princ) ) ;;The textheight in table depends on cannonscale (defun insert_table (lst pct / tab row col ht i n) (setq ht (/ 2.5 (getvar 'cannoscalevalue)) pct (trans pct 1 0) n (trans '(1 0 0) 1 0 T) tab (setq tab (vla-addtable space (vlax-3d-point pct) (+ 2 (length lst)) (length (car lst)) (* 2.5 ht) ht)) ) (vlax-put tab 'direction n) (mapcar (function (lambda (rowType) (vla-SetTextStyle tab rowType (getvar 'textstyle)) (vla-SetTextHeight tab rowType ht) ) ) '(2 4 1) ) (vla-put-HorzCellMargin tab (* 0.14 ht)) (vla-put-VertCellMargin tab (* 0.14 ht)) (setq lst (cons '("Width" "Length" "Pcs.") lst)) (setq i 0) (foreach col (apply 'mapcar (cons 'list lst)) (vla-SetColumnWidth tab i (apply 'max (mapcar '(lambda (x) ((lambda (txb) (+ (abs (- (caadr txb) (caar txb))) (* 2.0 ht))) (textbox (list (cons 1 (vl-princ-to-string x)) (cons 7 (getvar 'textstyle)) (cons 40 ht))) ) ) col ) ) ) (setq i (1+ i)) ) (setq lst (cons '("RECTANGLES") lst)) (setq row 0) (foreach r lst (setq col 0) (vla-SetRowHeight tab row (* 1.5 ht)) (foreach c r (vla-SetText tab row col (vl-princ-to-string c)) (setq col (1+ col)) ) (setq row (1+ row)) ) ) (princ "\nType RECDIMS to start the command")
  2. Hi All, I hope this is the right approach to my problem - I have searched the forum (and the net) a few times but am yet to find a solution. First and foremost - I am using AutoCad 2014 on a Macintosh...what I would't do for laydel... I work within the Entertainment Sector for a promoter. We regularly receive plans from external sources, many of which are in pretty poor shape. I am required to strip these down but find this very difficult when there are many blocks within the drawing with their layers not set to 0. e.g I am currently stripping down a venue plan, with over 60 blocks, all with different layers. I cant delete the unnecessary layers without changing the layers within the blocks. This is VERY tedious manually. I am hoping someone can help me with a lisp routine to do this automatically. I have been following a thread: "http://www.cadtutor.net/forum/showthread.php?19161-lisp-for-changing-all-objects-in-a-block-to-layer-quot-0-quot/page3" but am unable to get the lisps offered to work (though the one by kpblc seemed to get the closest) and am wondering if this is because I am using Mac? My understanding is that Mac has issues running anything other than AutoLISP? Any help would be appreciated. The thought of doing this manually again is just a little overwhelming and its an issue I am going to continue facing. Cheers, David
×
×
  • Create New...