See the top rated post in this thread. Click here

Page 4 of 6 FirstFirst 123456 LastLast
Results 31 to 40 of 52

Thread: Lisp Legend

  1. #31
    All AUGI, all the time
    Join Date
    2010-06
    Posts
    962
    Login to Give a bone
    1

    Default Re: Lisp Legend

    Quote Originally Posted by _brxdvs View Post
    yes that is one of the point styles
    Good to hear that.

    Please add the full line of codes as follows:
    Code:
     (setq name (vlax-get-property pntstyle 'name))
    Below your line of codes as follows:
    Code:
     (setq pntstyle (vlax-get point 'style))
    Like this ...
    Code:
    (setq pntstyle (vlax-get point 'style)) 
    (setq name (vlax-get-property pntstyle 'name))
    ... into your previous complete routine.


    So the variable 'name' should have the name of the point style.

    Hope this clear enough to you otherwise just ask if you stuck with any.

  2. #32
    Member
    Join Date
    2017-10
    Location
    Florida
    Posts
    26
    Login to Give a bone
    0

    Default Re: Lisp Legend

    Thank you sir!

    got this:

    Command: POINTTEST
    ("VLT")

    one element solved!

    next step, how do I "filter" the list to just get unique names? as in no repeating styles, just capture one instance of each point style.
    Last edited by _brxdvs; 2017-12-19 at 03:34 PM.

  3. #33
    All AUGI, all the time
    Join Date
    2010-06
    Posts
    962
    Login to Give a bone
    0

    Default Re: Lisp Legend

    Quote Originally Posted by _brxdvs View Post
    Thank you sir!
    You are welcome.

    Quote Originally Posted by _brxdvs View Post
    next step, how do I "filter" the list to just get unique names? as in no repeating styles, just capture one instance of each point style.
    As I have did in post no# 15 HERE so just use member function against your list with cons function.

    EDIT: Next time when you copy and paste codes that is not yours then it would be a respectful manner to give credits to authors / owners.
    Last edited by Tharwat; 2017-12-19 at 04:02 PM.

  4. #34
    All AUGI, all the time
    Join Date
    2010-06
    Posts
    962
    Login to Give a bone
    0

    Default Re: Lisp Legend

    Quote Originally Posted by Tharwat View Post
    EDIT: Next time when you copy and paste codes that is not yours then it would be a respectful manner to give credits to authors / owners.
    I meant THIS THREAD

  5. #35
    Member
    Join Date
    2017-10
    Location
    Florida
    Posts
    26
    Login to Give a bone
    0

    Default Re: Lisp Legend

    my apologies.

  6. #36
    Member
    Join Date
    2017-10
    Location
    Florida
    Posts
    26
    Login to Give a bone
    0

    Default Re: Lisp Legend

    this works now

    Code:
    (defun c:pointtest2 (/ pntSel index pntStyle styleList)
      (if (setq pntSel (ssget "_X" '((0 . "AECC_COGO_POINT")))) ;selects all cogo points in drawing
        (repeat (setq index (sslength pntSel))
          (or (member (setq pntStyle (vlax-get-property (vlax-get (vlax-ename->vla-object (ssname pntSel (setq index (1- index)))) 'style) 'name)) styleList)
              (setq styleList (cons pntStyle styleList))
          );end or
        );end repeat
      );end if
      (print styleList);used for testing delete before final
      (princ)
    ) (vl-load-com)
    thanks for all your help!
    Last edited by _brxdvs; 2017-12-19 at 07:27 PM.

  7. #37
    All AUGI, all the time
    Join Date
    2010-06
    Posts
    962
    Login to Give a bone
    1

    Default Re: Lisp Legend

    Following your way of coding.

    Code:
    (defun c:pointtest (/ selpnt n index pntlist point pntstyle stylelist pntname)
      (if (setq selpnt (ssget "X" '((0 . "AECC_COGO_POINT")))) ;selects the cogo points
        (progn
          (setq n (sslength selpnt))
          (setq index 0)
          (repeat n
            (setq pntlist (entget (ssname selpnt index)))
            (setq point (vlax-ename->vla-object (cdr (assoc -1 pntlist))))
            (setq pntstyle (vlax-get point 'style))
            (setq pntname (vlax-get-property pntstyle 'name))
            (if (not (member pntname stylelist))
              (setq stylelist (cons pntname stylelist))
            )
            (setq index (1+ index))
          )
          (print stylelist)
        )
      )
      (princ)
    ) (vl-load-com)

  8. #38
    Member
    Join Date
    2017-10
    Location
    Florida
    Posts
    26
    Login to Give a bone
    0

    Default Re: Lisp Legend

    Thanks for your help Tharwat!

  9. #39
    All AUGI, all the time
    Join Date
    2010-06
    Posts
    962
    Login to Give a bone
    0

    Default Re: Lisp Legend

    Quote Originally Posted by _brxdvs View Post
    Thanks for your help Tharwat!
    You are welcome anytime.

  10. #40
    Member
    Join Date
    2017-10
    Location
    Florida
    Posts
    26
    Login to Give a bone
    0

    Default Re: Lisp Legend

    So, opened a new drawing and I am getting this error: ; error: bad argument type: VLA-OBJECT nil when using the code from yesterday.

    I think it has to do with some cogo points that don't have styles applied and are set to default, is there a way to exclude nil values?

Page 4 of 6 FirstFirst 123456 LastLast

Similar Threads

  1. Replies: 5
    Last Post: 2016-01-10, 04:44 PM
  2. Replies: 7
    Last Post: 2014-05-15, 03:00 PM
  3. Tags in Legend Views / Tag legend components
    By Wish List System in forum Revit Architecture - Wish List
    Replies: 0
    Last Post: 2012-11-14, 07:08 AM
  4. Replies: 3
    Last Post: 2012-05-07, 08:16 PM
  5. Copy / Paste from Legend to Legend
    By antman in forum Revit Architecture - General
    Replies: 5
    Last Post: 2011-04-12, 03:22 PM

Tags for this Thread

Posting Permissions

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