Jump to content

Search the Community

Showing results for tags 'group'.



More search options

  • 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

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Found 5 results

  1. martinle

    hatch2group

    Hello, I have taken the following code lines from the formum and tried something to change. My problem is that it does not always work. Unfortunately, I can not see the reason why it often works and often not. This Lisp should: There are many groups of objects in the drawing. The drawing already contains some default hatching. 1) The user selects an existing hatching and then fills different areas belonging to different groups With this hatching. 2) When the user has finished the "_ADDSELECTED" command, the Lisp should add each individual hatch to the group that they have encloses. It works often but not always! Why? Please help. Martin Lisp: ;;----------------------=={ Inside-p }==----------------------;; ;; ;; ;; Predicate function to determine whether a point lies ;; ;; inside a supplied LWPolyline. ;; ;;------------------------------------------------------------;; ;; Author: Lee Mac - www.lee-mac.com ;; ;; Using some code by gile (as marked below), thanks gile. ;; ;;------------------------------------------------------------;; ;; Arguments: ;; ;; pt - 3D WCS point to test ;; ;; ent - LWPolyline Entity against which to test point ;; ;;------------------------------------------------------------;; ;; Returns: T if supplied point lies inside supplied LWPoly ;; ;;------------------------------------------------------------;; (defun LM:Inside-p (pt ent / _GroupByNum lst nrm obj tmp) (defun _GroupByNum (l n / r) (if l (cons (reverse (repeat n (setq r (cons (car l) r) l (cdr l) ) r ) ) (_GroupByNum l n) ) ) ) (if (= (type ent) 'VLA-OBJECT) (setq obj ent ent (vlax-vla-object->ename ent) ) (setq obj (vlax-ename->vla-object ent)) ) (setq lst (_GroupByNum (vlax-invoke (setq tmp (vlax-ename->vla-object (entmakex (list (cons 0 "RAY") (cons 100 "AcDbEntity") (cons 100 "AcDbRay") (cons 10 pt) (cons 11 (trans '(1. 0. 0.) ent 0)) ) ) ) ) 'IntersectWith obj acextendnone ) 3 ) ) (vla-delete tmp) (setq nrm (cdr (assoc 210 (entget ent)))) ;; gile: (and lst (not (vlax-curve-getparamatpoint ent pt)) (= 1 (rem (length (vl-remove-if (function (lambda (p / pa p- p+ p0 s1 s2) (setq pa (vlax-curve-getparamatpoint ent p)) (or (and (equal (fix (+ pa (if (minusp pa) -0.5 0.5 ) ) ) pa 1e-8 ) (setq p- (cond ((setq p- (vlax-curve-getPointatParam ent (- pa 1e- ) ) (trans p- 0 nrm) ) ((trans (vlax-curve-getPointatParam ent (- (vlax-curve-getEndParam ent) 1e- ) 0 nrm ) ) ) ) (setq p+ (cond ((setq p+ (vlax-curve-getPointatParam ent (+ pa 1e- ) ) (trans p+ 0 nrm) ) ((trans (vlax-curve-getPointatParam ent (+ (vlax-curve-getStartParam ent) 1e- ) 0 nrm ) ) ) ) (setq p0 (trans pt 0 nrm)) (<= 0 (* (sin (angle p0 p-)) (sin (angle p0 p+)))) ;; LM Mod ) (and (/= 0. (vla-getBulge obj (fix pa))) (equal '(0. 0.) (cdr (trans (vlax-curve-getFirstDeriv ent pa) 0 nrm) ) 1e-9 ) ) ) ) ) lst ) ) 2 ) ) ) ) (defun c:hatch2group (/ ss i lst pt ent drehwink pt1 as OBJ AWS mypick) (setq mypick (getvar "pickstyle")) (setvar "pickstyle" 0) (setq OBJ (entlast)) (command "_ADDSELECTED" Pause (setq pt1 (getpoint "\nPick Point: ")) ) (while (/= (getvar "CMDACTIVE") 0) (command pause)) (setq AWS (ssadd)) (while (setq OBJ (entnext OBJ)) (ssadd OBJ AWS)) (sssetfirst AWS AWS) (setq as (entlast)) (if (and (setq ss (ssget "_X" '((0 . "LWPOLYLINE")))) (repeat (setq i (sslength ss)) (setq lst (cons (ssname ss (setq i (1- i))) lst)) ) (setq pt pt1) ) ;(if (setq ent (car (vl-member-if (function (lambda (x) (LM:Inside-p (trans pt 1 0) x)) ) lst ) ) ) ;(vla-put-color (vlax-ename->vla-object ent) acRed) ) (princ) (command "_groupedit" ent "H" AWS "") (while (/= (getvar "CMDACTIVE") 0) (command pause)) (setvar "pickstyle" mypick) (princ) ) (princ)
  2. Morning All, Habitual LT user here - so no lsp before. Been given 2 month access to a 2014 license to get this job out of the door. I'm trying to create a lsp that grabs the content of a drawing, selects objects by layer and groups them using the layer name as the group name. I've found a couple of lsps that do some of what I want so I've been pulling them to bits and trying to create what I need, but I'm stuck. I've managed to get to a point where I've got a list of the layers and start the group command but I cant get the group names to work. I'm not demanding a full lsp, but would very much appreciate some guidance on how to approach this one. I've gone through the tutorials on Afralisp and some of the other threads but I just don't seem to be making any progress. There's 41 layers in most of these drawings, I don't really fancy doing it manually... PS I cant access any of Autodesks online help as apparently our IT guys have classified it as an "unsafe site".
  3. Hi to all, Any one knows a Lisp that could insert many files (sheets) on only one dwg file? Thanks in advance!...
  4. If I make a group of blocks (select all the blocks I want, GROUP in command, enter), it then won't let me remove certain blocks from that group. When I try to Explode the group, it explodes all the individual blocks as well... I know that Ctrl-H can turn on and off the Groups option, but short of erasing the block I don't want to be included anymore, how can I manipulate what goes on within a group? And I know I can UNGROUP to completely separate out all the components... there just seems like there should be a way to go "into" the group and select-out or add-in individual components... Thanks
  5. UCLandArch

    Grouping/Trimming Blocks

    I am new to AutoCAD from another CAD software (DynaScape). I am a landscape architect and I am wanting to combine multiple blocks (ie: shrubs, trees, etc) and then trim any overlapping lines/plines. Any help on creating and editing these blocks on AutoCAD MAC would be most helpful!
×
×
  • Create New...