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?
|
|
|
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?
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)) ) )
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.
However I am getting this error: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)
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.
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)
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.
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.Code:(if (setq sel (ssget "_X" '((0 . "AECC_COGO_POINT")))) (vlax-dump-object (vlax-ename->vla-object (ssname sel 0)) 't) )
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
Command: POINTTEST
(#<VLA-OBJECT IAeccPointStyle 0000022e7346f8e0> #<VLA-OBJECT IAeccPointStyle 0000022e73453a40>)
now if I could only find something to use in that.