See the top rated post in this thread. Click here

Page 2 of 6 FirstFirst 123456 LastLast
Results 11 to 20 of 52

Thread: Lisp Legend

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

    Default Re: Lisp Legend

    I have modified my reply before you have posted yours so can you please try the sample codes in my last reply and let me know how you get on with it?

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

    Default Re: Lisp Legend

    this from the command line:
    Command: (setq ss (ssget "_X" '((0 . "INSERT")(2 . "VLT"))))
    <Selection set: 183e>

    nothing happened on screen but a selection set was built.

  3. #13
    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
    this from the command line:
    Command: (setq ss (ssget "_X" '((0 . "INSERT")(2 . "VLT"))))
    <Selection set: 183e>

    nothing happened on screen but a selection set was built.
    Yes that is just the selection set and it approves that the objects are block references.

    Try this iteration codes through block table and you should have the block names into the variable 'lst after all.

    Code:
    (while (setq blk (tblnext "BLOCK" (not blk)))
      (or (wcmatch (setq name (cdr (assoc 2 blk))) "_*,`**,*|*")
          (setq lst (cons name lst))
          )
      )

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

    Default Re: Lisp Legend

    I think we got a little side tracked. I have a routine that uses tblnext for blocks. I need to use the cogo points. You have been very helpful so far.

    I was trying to use this to build a list of the point styles from the points in the drawing.

    Code:
    (defun C:pointtest ( / selPnt n index pntList pntStyle styleList)
    	(vl-load-com)	
    	(setq selPnt (ssget "x" '((0 . "AECC_COGO_POINT")))) ;selects the cogo points
    	(setq n (sslength selPnt))
    	(setq index 0)
    	(repeat n
    		(setq pntList (entget (ssname selPnt index)))
    		(setq Point (vlax-ename->vla-object (cdr (assoc -1 selPnt))))
    		(setq pntStyle (VLAX-GET Point 'pointstyle))
    		(setq styleList (cons pntStyle styleList)) ;build a list of point styles from the current drawing.
    		(setq index (1+ index))
    	);repeat
    	(print styleList)
    	(princ)
    );defun
    (princ)
    However I am getting this error:
    Command: POINTTEST
    ; error: bad argument type: listp <Selection set: 1b1d>

    I was hoping I could build the list then compare it to the list of block names and build the legend.

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

    Default Re: Lisp Legend

    Try this please and let me know;

    NOTE: the un-repeated points' styles names must be available in the variable 'lst'

    Code:
    (defun c:pointtest (/ sel ind sty lst)
      (if (setq sel (ssget "_X" '((0 . "AECC_COGO_POINT"))))
        (repeat (setq ind (sslength sel))
          (or (member (setq sty (vlax-get (vlax-ename->vla-object (ssname sel (setq ind (1- ind)))) 'pointstyle)) lst)
              (setq lst (cons sty lst))
          )
        )
      )
      (princ)
    ) (vl-load-com)

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

    Default Re: Lisp Legend

    received this error:

    ; error: ActiveX Server returned the error: unknown name: "POINTSTYLE"

  7. #17
    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
    received this error:

    ; error: ActiveX Server returned the error: unknown name: "POINTSTYLE"
    That should not occur since that I followed your procedure and it did work for you.

    Please run the following codes in the command line and paste the return here.

    Code:
    (if (setq sel (ssget "_X" '((0 . "AECC_COGO_POINT"))))
        (vlax-dump-object (vlax-ename->vla-object (ssname sel 0)) 't)
      )
    Time is running fast so please test the codes and paste the return to allow me to modify the final codes for your final test.

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

    Default Re: Lisp Legend

    Code:
    Command: (if (setq sel (ssget "_X" '((0 . "AECC_COGO_POINT"))))
    (_>     (vlax-dump-object (vlax-ename->vla-object (ssname sel 0)) 't)
    (_>   )
    ; IAeccPoint: IAeccPoint Interface
    ; Property values:
    ;   Application (RO) = #<VLA-OBJECT IAeccApplication 0000022e72040570>
    ;   Convergence (RO) = -0.0137591
    ;   Description = "VLT"
    ;   DescriptionFormat = "$*"
    ;   DisplayName (RO) = Civil 3D API: The parameter is incorrect.
    ;   Document (RO) = #<VLA-OBJECT IAeccDocument 0000022e7203fbb0>
    ;   Easting = 22840.7
    ;   Elevation = 99.1283
    ;   EntityTransparency = "ByLayer"
    ;   FullDescription (RO) = "VLT"
    ;   GridEasting = 22840.7
    ;   GridNorthing = 48241.6
    ;   Handle (RO) = "392E5"
    ;   HasExtensionDictionary (RO) = 0
    ;   Hyperlinks (RO) = #<VLA-OBJECT IAcadHyperlinks 0000022e7535a308>
    ;   LabelRotation = 0.0
    ;   LabelStyle = #<VLA-OBJECT IAeccLabelStyle 0000022e6497aee0>
    ;   Latitude = 0.426805
    ;   Layer = "PT"
    ;   Linetype = "ByLayer"
    ;   LinetypeScale = 1.0
    ;   Lineweight = -1
    ;   Location = (22840.7 48241.6 99.1283)
    ;   Longitude = -1.44694
    ;   Material = "ByLayer"
    ;   Name = ""
    ;   Northing = 48241.6
    ;   Number = 7811
    ;   ObjectID (RO) = 55
    ;   ObjectName (RO) = "AeccDbCogoPoint"
    ;   OwnerID (RO) = 56
    ;   PlotStyleName = "ByLayer"
    ;   ProjectVersion (RO) = Civil 3D API: The parameter is incorrect.
    ;   RawDescription = "VLT"
    ;   Rotation = 0.0
    ;   Scale (RO) = 1.0004
    ;   ShowToolTip = -1
    ;   Style = #<VLA-OBJECT IAeccPointStyle 0000022e7346f8e0>
    ;   StyleName (RO) = "<none>"
    ;   SurveyPoint (RO) = 0
    ;   TrueColor = #<VLA-OBJECT IAcadAcCmColor 0000022e75359580>
    ;   Visible = -1
    ;   XYScale = 1.0
    ;   ZScale = 1.0
    ; Methods supported:
    ;   ArrayPolar (3)
    ;   ArrayRectangular (6)
    ;   Copy ()
    ;   Delete ()
    ;   GetBoundingBox (2)
    ;   GetExtensionDictionary ()
    ;   GetUserDefinedPropertyValue (1)
    ;   GetXData (3)
    ;   Highlight (1)
    ;   IntersectWith (2)
    ;   IsReferenceObject ()
    ;   IsReferenceStale ()
    ;   IsReferenceSubObject ()
    ;   IsReferenceValid ()
    ;   Mirror (2)
    ;   Mirror3D (3)
    ;   Move (2)
    ;   Rotate (2)
    ;   Rotate3D (3)
    ;   ScaleEntity (2)
    ;   SetUserDefinedPropertyValue (2)
    ;   SetXData (2)
    ;   TransformBy (1)
    ;   Update ()
    T
    Last edited by rkmcswain; 2018-01-19 at 01:21 PM. Reason: added [CODE] tags

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

    Default Re: Lisp Legend

    Replace 'pointstyle with 'style as in my last posted code.

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

    Default Re: Lisp Legend

    Command: POINTTEST
    (#<VLA-OBJECT IAeccPointStyle 0000022e7346f8e0> #<VLA-OBJECT IAeccPointStyle 0000022e73453a40>)

    now if I could only find something to use in that.

Page 2 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
  •