+ Reply to Thread
Page 2 of 2 FirstFirst 1 2
Results 11 to 14 of 14
  1. #11
    Junior Member
    Using
    AutoCAD 2008
    Join Date
    May 2012
    Posts
    24

    Default

    Registered forum members do not see this ad.

    So, now, i suppose Pbe won't ask me again to show my code . You like it, Pbe? The best code on the site!

  2. #12
    Forum Deity pBe's Avatar
    Computer Details
    pBe's Computer Details
    Operating System:
    Windows XP
    Discipline
    Construction
    pBe's Discipline Details
    Discipline
    Construction
    Details
    Camp Construction planning and details
    Using
    AutoCAD 2009
    Join Date
    Apr 2010
    Posts
    2,090

    Default

    Quote Originally Posted by brams View Post
    So, now, i suppose Pbe won't ask me again to show my code
    Not at all brams

    Quote Originally Posted by brams View Post
    You like it, Pbe? The best code on the site!
    The idea is ok, just needs fine tuning.

    Look into this _GetClosestTextTo sub-function: Renderman < post #6

    HTH

  3. #13
    Forum Deity BlackBox's Avatar
    Using
    Civil 3D 2011
    Join Date
    Nov 2009
    Posts
    3,932

    Default

    Quote Originally Posted by MSasu View Post
    Quote Originally Posted by brams View Post
    A little help, please... for a new autolisp user

    Seems to be what i'm searching for. Please, an example how to use your function together with ssget... to make 2 selection sets of points and texts, selecting objects only one time - i mean, a single "rectangle".
    @brams: What editor are you using? Seems that you pasted some control tags along AutoLISP code.
    Or did you tried to number the lines?!?
    I've copied the code that I previously linked here.

    Quote Originally Posted by pBe View Post
    FWIW
    Code:
    (defun c:sepsel ()
           (setq textsel  (ssadd)  PointSel (ssadd)
                  ss       (ssget '((0 . "POINT,TEXT"))))
                 (while (setq e (ssname ss 0))
       (if (eq (cdr (assoc 0 (entget e))) "POINT")
        (ssadd e PointSel)(ssadd e textsel))
                          (ssdel e ss)))
    Perhaps localized variables would be useful? Otherwise running the code multiple times would provide some interesting results.

    Quote Originally Posted by pBe View Post
    Cheers, Pbe
    "Potential has a shelf life." - Margaret Atwood

  4. #14
    Senior Member
    Discipline
    Structural
    Using
    AutoCAD 2011
    Join Date
    Sep 2011
    Location
    Baia Mare, Romania
    Posts
    136

    Default

    Registered forum members do not see this ad.

    Brams, this is what you need?
    Code:
    (defun C:PZ ( / *error* ss i en el p p1 echo)
      
      (setq echo (getvar 'cmdecho))
      (setvar 'cmdecho 0)
      (command "UNDO" "BE")
      
      (defun *error* (msg)
        (if msg (princ msg))
        (command "UNDO" "E")
        (setvar 'cmdecho echo)
        (princ)
        )
      (princ "\nSELECTEAZA PUNCTELE SI TEXTELE")
      (if
        (setq ss (ssget '((0 . "TEXT,POINT") (8 . "Puncte,Cote")))) ; <- de modificat numele layerelor
        (repeat (setq i (sslength ss))
          (setq en (ssname ss (setq i (1- i))))
          (if
            (setq z (cdr (assoc 1 (setq el (entget en)))))
            (progn
              (setq p (assoc 10 el)
                    p1 (list 10 (cadr p) (caddr p) (atof z))
                    )
              (entmake (list '(0 . "POINT") '(8 . "Puncte") p1))
              (entmod (subst p1 p el))
              )
            (entdel en)
            )
          )
        )
      (*error* nil)
      (princ)
      )

Similar Threads

  1. Selection sets in vb.net
    By Jozi68 in forum .NET, ObjectARX & VBA
    Replies: 8
    Last Post: 14th Feb 2012, 07:33 pm
  2. VBA - Selection Sets
    By -KarL- in forum AutoLISP, Visual LISP & DCL
    Replies: 17
    Last Post: 3rd Mar 2009, 10:54 am
  3. VBA - Using IF and selection sets
    By wannabe in forum AutoLISP, Visual LISP & DCL
    Replies: 4
    Last Post: 23rd Oct 2008, 02:09 pm
  4. Little help on selection sets please
    By Galingula in forum AutoCAD Drawing Management & Output
    Replies: 2
    Last Post: 17th Apr 2006, 03:39 pm
  5. selection sets..........
    By rajanikrishna in forum AutoLISP, Visual LISP & DCL
    Replies: 1
    Last Post: 14th Nov 2005, 11:32 am

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts