Author Topic: Tool to log (selectable) props with ActiveX  (Read 1997 times)

0 Members and 1 Guest are viewing this topic.

Peter2

  • Swamp Rat
  • Posts: 653
Tool to log (selectable) props with ActiveX
« on: December 31, 2013, 03:58:34 AM »
I need a tool with analyses and writes (selectable) props and entities of a drawing to text-files, like ...

Code: [Select]
List of Blocks:
x
y

List of Textstyles:
a
b

List of Layers:
1
2

List of Colors:
2
5
256

List of Plotstyles:
a.ctb
x.ctb

List of Textfonts:
a.ttf
b.shx

I should be based on ActiveX to use it with ObjectDBX; the perfect solution also should has a fine dialogue to select what I want to analyse.

Any ideas or hints?

Thanks and happy new year
« Last Edit: December 31, 2013, 04:04:31 AM by Peter2 »
Peter

AutoCAD Map 3D 2023 German (so some technical terms will be badly retranslated to English)
BricsCAD V23

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Tool to log (selectable) props with ActiveX
« Reply #1 on: December 31, 2013, 05:13:37 AM »
Do you want help to write it or do you want it written for you?
For AutoCAD or Bricscad?
What would the colors be for?


You could start here:

Code - Auto/Visual Lisp: [Select]
  1. (or kglobal:acadapp (setq kglobal:acadapp (vlax-get-acad-object)))
  2. (or     kglobal:activedoc
  3.         (setq kglobal:activedoc (vla-get-activedocument kglobal:acadapp))
  4. )
  5. ;;; ------------------------------------------------------------------
  6. ;;; ------------------------------------------------------------------
  7. ;;; Return list of all collection member names
  8. ;;;
  9. (defun kdub:listcollmbrnames (collection / itemname returnvalue)
  10.   (setq returnvalue '())
  11.   (vlax-for each collection
  12.     (setq itemname    (vla-get-name each)
  13.           returnvalue (cons itemname returnvalue)
  14.     )
  15.   )
  16.   (reverse returnvalue)
  17. )
  18. ;;; ------------------------------------------------------------------
  19. ;;; ------------------------------------------------------------------
  20.  
  21. (defun kdub:listdocuments ()
  22.   (kdub:listcollmbrnames kglobal:documents)
  23. )
  24.  
  25. (defun kdub:listviews ()
  26.   (kdub:listcollmbrnames (vla-get-views kglobal:activedoc))
  27. )
  28.  
  29.  
  30. (defun kdub:listviewports ()
  31.   (kdub:listcollmbrnames (vla-get-viewports kglobal:activedoc))
  32. )
  33.  
  34. (defun kdub:listucss ()
  35.   (kdub:listcollmbrnames
  36.         (vla-get-usercoordinatesystems kglobal:activedoc)
  37.   )
  38. )
  39.  
  40. (defun kdub:listlayouts ()
  41.   (kdub:listcollmbrnames (vla-get-layouts kglobal:activedoc))
  42. )
  43.  
  44. (defun kdub:listgroups ()
  45.   (kdub:listcollmbrnames (vla-get-groups kglobal:activedoc))
  46. )
  47.  
  48.  
  49. (defun kdub:listregapps ()
  50.   (kdub:listcollmbrnames
  51.         (vla-get-registeredapplications kglobal:activedoc)
  52.   )
  53. )
  54.  
  55. (defun kdub:listplotconfigs     ()
  56.   (kdub:listcollmbrnames (vla-get-plotconfigurations kglobal:activedoc)
  57.   )
  58. )
  59.  
  60. (defun kdub:listlinetypes ()
  61.   (kdub:listcollmbrnames (vla-get-linetypes kglobal:activedoc))
  62. )
  63.  
  64. (defun kdub:listtextstyles ()
  65.   (kdub:listcollmbrnames (vla-get-textstyles kglobal:activedoc))
  66. )
  67.  
  68. (defun kdub:listdimstyles ()
  69.   (kdub:listcollmbrnames (vla-get-dimstyles kglobal:activedoc))
  70. )
  71.  
  72. (defun kdub:listmenugroups ()
  73.   (kdub:listcollmbrnames (vla-get-menugroups kglobal:acadapp))
  74. )
  75.  
  76. (defun kdub:listmenubar ()
  77.   (kdub:listcollmbrnames (vla-get-menubar kglobal:acadapp))
  78. )
  79.  
  80. (defun kdub:listlayers ()
  81.   (kdub:listcollmbrnames (vla-get-layers kglobal:activedoc))
  82. )
  83.  
  84. (defun kdub:listblocks ()
  85.   (kdub:listcollmbrnames (vla-get-blocks kglobal:activedoc))
  86. )
  87.  
  88.  
  89.  
  90. (defun kdub:activeviewport ()
  91.   (if (wcmatch (vla-get-name (kdub:activespace)) "*Model*")
  92.     (vla-get-activeviewport kglobal:activedoc)
  93.     (vla-get-activepviewport kglobal:activedoc)
  94.   )
  95. )
  96. (defun kdub:activedimstyle () (vla-get-activedimstyle kglobal:activedoc))
  97. (defun kdub:activelayer () (vla-get-activelayer kglobal:activedoc))
  98. (defun kdub:activelayout () (vla-get-activelayout kglobal:activedoc))
  99. (defun kdub:activelinetype () (vla-get-activelinetype kglobal:activedoc))
  100.  
  101. (defun kdub:activetextstyle () (vla-get-activetextstyle kglobal:activedoc))
  102. (defun kdub:activeucs () (vla-get-activeucs kglobal:activedoc))
  103.  
  104.  
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Peter2

  • Swamp Rat
  • Posts: 653
Re: Tool to log (selectable) props with ActiveX
« Reply #2 on: December 31, 2013, 06:14:13 AM »
Do you want help to write it or do you want it written for you?...
I need help; but if the help consists of a "perfect, opensource, freeware in Lisp" it would also be appreciated  :laugh:

...For AutoCAD or Bricscad?...
AutoCAD.

...What would the colors be for?...
Mainly to check the "bylayer-conformity" of the drawing - very often the drawing-standards do not allow free colors, it has to be on "Bylayer". But I know that not all drawing situation could be checked by this method.

...You could start here:...
Thanks it lot. It looks very fine to start.
Peter

AutoCAD Map 3D 2023 German (so some technical terms will be badly retranslated to English)
BricsCAD V23

rhino

  • Guest
Re: Tool to log (selectable) props with ActiveX
« Reply #3 on: December 31, 2013, 07:06:23 AM »

...What would the colors be for?...
Quote
Mainly to check the "bylayer-conformity" of the drawing - very often the drawing-standards do not allow free colors, it has to be on "Bylayer". But I know that not all drawing situation could be checked by this method.

I use this snippet to set layer line weight to 0
Code - Auto/Visual Lisp: [Select]
  1.           (setq  activedoc  (vla-get-activedocument (vlax-get-acad-object))
  2.                  lay_tbl    (vla-get-layers activedoc)
  3.                 )
  4.                  (vlax-for each lay_tbl (vla-put-LineWeight each 0))
  5.  
you can use (vla-put-color) to set the entities to "by layer"; however you would need get all entities in the drawing - I don't think this could be done using dbx (may be wrong) :angel: