Selection Set (ssget) COGO point from name Group

Selection Set (ssget) COGO point from name Group

Anonymous
Not applicable
1,678 Views
8 Replies
Message 1 of 9

Selection Set (ssget) COGO point from name Group

Anonymous
Not applicable

Hello everyone.
Tell me please.
I get a list of group names COGO point in my drawing.

Now, having selected the name of the group, I want to add to the set all the COGO points from this group.

I searched on the Internet but did not find a solution.

I will be glad of any help.

0 Likes
Accepted solutions (1)
1,679 Views
8 Replies
Replies (8)
Message 2 of 9

Sea-Haven
Mentor
Mentor

Civ3D works very different than normal objects, point within a group may be easy or not. What are you trying to do once you have them or is it for set out etc You can export a group from CIV3D. 

0 Likes
Message 3 of 9

Anonymous
Not applicable

I want to select COGO points in a drawing by function ssget with filter.

A filter is the name of a group of these points.

0 Likes
Message 4 of 9

Sea-Haven
Mentor
Mentor

Not sure that you can via lisp can get a listing of all point numbers in a group and then make a list etc

 

Still the question then what ?

0 Likes
Message 5 of 9

john.uhden
Mentor
Mentor

You could get the point groups in LDT from the ActiveProject object, but I don't know how C3D works.  It's not project based.

John F. Uhden

0 Likes
Message 6 of 9

Sea-Haven
Mentor
Mentor

Thanks John, not a problem have a lot of civ3d stuff, a dump of point group = name, reveals a list of the point numbers in the group as a property. Then you would open the master "POINTS" and pull out each of these cogo points by its point number. You are right have to open the CIV3D database some times. a 

 

That's why I asked what is the end question don't want to waste time and throw code away and start again.

 

a quick sample

 

 

 ; 2020 is 13.2
(setq aeccApp (vla-getinterfaceobject
(vlax-get-acad-object)
"AeccXUiLand.AeccApplication.13.2"
)
)
(setq aeccDoc (vlax-get-property aeccApp "ActiveDocument"))
(setq pg (vlax-get-property aeccDoc "Pointgroups"))
(vlax-for Pointg pg
(if (= "_All Points" (vla-get-name pointg))
(setq ptlst (vlax-get pointg 'Points))
)
)
(alert (strcat "There is " (rtos  (length ptlst) 2 0) " points in the group " "_All Points"))

 

 

0 Likes
Message 7 of 9

Anonymous
Not applicable
Accepted solution

No. It is possible!

 

(defun SS_cogo_from_PointGroup ( namePointGroup / OP:c3ddoc lstPG grp ptnums all_cogo x itm point selectionsetcogo )
; Example: (SS_cogo_from_PointGroup "kek")
(vl-load-com)
;-----------------------------------------
(defun OP:c3ddoc (/ prod verstr c3dver)
    (defun c3dver (/ c3d *acad*)
      (setq C3D	(strcat	"HKEY_LOCAL_MACHINE\\"
			(if vlax-user-product-key
			  (vlax-user-product-key)
			  (vlax-product-key)
			)
		)
	    C3D	(vl-registry-read C3D "Release")
	    c3d	(substr
		  C3D
		  1
		  (vl-string-search
		    "."
		    C3D
		    (+ (vl-string-search "." C3D) 1)
		  )
		)
      )
      c3d
    )
    (if	(not _C3DDoc)
      (setq
	_C3DDoc	(vla-get-activedocument
		  (vla-getinterfaceobject
		    (vlax-get-acad-object)
		    (strcat "AeccXUiLand.AeccApplication." (c3dver))
		  )
		)

      )
    )
    _C3DDoc
  )
;-----------------------------------------
(setq lstPG (vlax-get-property (OP:c3ddoc) 'PointGroups)
      grp (vlax-invoke lstpg 'item namePointGroup)
      ptnums (vlax-get grp 'points); point number from PointGroup list
); end of setq
(if
    (and (setq all_cogo (ssget "_X" '((0 . "AECC_COGO_POINT"))))
	 (setq all_cogo	(vl-remove-if
			  'listp
			  (mapcar 'cadr
				  (ssnamex all_cogo)
			  )
			)
	 )
	 (setq
	   all_cogo (mapcar
		      (function
			(lambda	(x)
			  (list
			    (vlax-get (vlax-ename->vla-object x) 'Number)
			    x
			  )
			)
		      )
		      all_cogo
		    )
	 )
    )
(progn
(setq selectionsetcogo (ssadd))
(foreach itm ptnums 
    (setq point (cadr (assoc itm all_cogo)))
	  ; (setq p_lst_obj (cons point p_lst_obj))
	      (setq selectionsetcogo (ssadd point selectionsetcogo)); 
); end of foreach
); end of progn
(print "Points with this number do not exist!")
); end of if
selectionsetcogo
); end of defun
0 Likes
Message 8 of 9

Sea-Haven
Mentor
Mentor

"No its possible."

 

I did not say it could not be done I asked and again what is the end result what are you doing with the selection !!!

 

Also no need for the ssget as you can get the point details directly from CIV3D "Points". There will be no point missing as you have a list of points from the group if that errors then point group has not been possibly updated.

0 Likes
Message 9 of 9

Anonymous
Not applicable

Ok. 

0 Likes