Author Topic: finding point group name  (Read 1392 times)

0 Members and 1 Guest are viewing this topic.

entget

  • Mosquito
  • Posts: 19
finding point group name
« on: February 02, 2016, 01:03:13 PM »
i have been trying to find the Primary Point Group name(?) of an aecc_cogo_point.
...tried this: (vlax-dump-object (vlax-Ename->Vla-Object (car ent)) T)
but don't see what i'm looking for - screen capture attached hopefully

thanks
corey

Jeff_M

  • King Gator
  • Posts: 4088
  • C3D user & customizer
Re: finding point group name
« Reply #1 on: February 02, 2016, 02:45:59 PM »
With the COM API you need to go through the PointGroups, check the DrawPriority property and if the PG Contains the point. The example uses one helper function not included here...(vl-sl), which just converts an object selected by (entsel) to a vla-object.

Code - Auto/Visual Lisp: [Select]
  1. (defun getcontrollinggroupforpoint (aeccdb cogopt / grppriority highestpriority ptgrp ptnum)
  2.   (setq highestPriority -1
  3.         ptNum (vlax-get cogopt 'Number)
  4.         )
  5.   (vlax-for grp (vlax-get aeccdb 'pointgroups)
  6.     (setq grpPriority (vlax-get grp 'drawpriority))
  7.     (if (and (> grpPriority highestPriority)
  8.              (= (vlax-invoke grp 'ContainsPoint ptNum) -1)
  9.              )
  10.       (progn
  11.         (setq ptgrp grp
  12.               highestPriority grpPriority
  13.               )
  14.         )
  15.       )
  16.     )
  17.   ptgrp
  18.   )
  19.    
  20. (defun c:checkgrp (/ c3d civdb civdoc pt grp)
  21.   (setq C3D (strcat "HKEY_LOCAL_MACHINE\\" (if vlax-user-product-key (vlax-user-product-key) (vlax-product-key) ) )
  22.       C3D (vl-registry-read C3D "Release")
  23.       C3D (substr C3D 1 (vl-string-search "." C3D (+ (vl-string-search "." C3D) 1) ) )
  24.       C3D (vla-getinterfaceobject *acad* (strcat "AeccXUiLand.AeccApplication." C3D) )
  25.       civdoc (vlax-get c3d 'activedocument)
  26.         civdb (vlax-get civdoc 'database)
  27.         )
  28.   (setq pt (vl-sel))  
  29.   (setq grp (getcontrollinggroupforpoint civdb pt))
  30.   (princ (strcat "\nControlling group for selected point is " (vlax-get grp 'name)))
  31.   )
  32.