Author Topic: macro to enumerate types in current selection  (Read 155 times)

bdeck

  • Hero Member
  • *****
  • Posts: 780
macro to enumerate types in current selection
« on: January 23, 2017, 12:43:00 PM »
Does what it says.
Depending on your monitor size and the complexity of the drawing, you may need to modify the macro to fit, pan, or scroll the enumerated types in the output window.

Code: [Select]
'ti.d3m   Type Info enumerates types in current selection      bdeck  1/2017

dim ecount(130), ename$(130)
precision 0
nent=sys(9)

for i=1 to nent
   getattr i,type,sel
   if (sel mod 2)=1 then
         if ecount(type)=0 then tcount=tcount+1
  ecount(type)=ecount(type)+1
  poscount=1+poscount
   endif
next i

rcount=tcount+5
gosub ntable
window rcount,50
print "Selected entities = ", poscount
print "Selected types = ", tcount
Print
Print "Count     Type ID     Type Description"
Print
for t=1 to 130
    if ecount(t)>0 then
        print "    ", ecount(t), "          ",t,"          ", ename$(t)
    endif   
next
anykey
end         

ntable:
  ename$(1)="Line"
  ename$(2)="Ellipse"
  ename$(3)="3D Text"
  ename$(4)="Curve"
  ename$(7)="Elliptical Arc"
  ename$(11)="Bezier Curve (4-point)"
  ename$(12)="Bezier Curve (Continuous)"
  ename$(13)="2D Text"
  ename$(15)="Attribute"
  ename$(16)="Circle, Circular Arc"
  ename$(17)="Hatch"
  ename$(22)="Text Arc"
  ename$(24)="Arrow"
  ename$(26)="Symbol"
  ename$(31)="Plane"
  ename$(32)="Grid Header"
  ename$(33)="Grid Line"
  ename$(34)="Group"
  ename$(68)="Construction Line"
  ename$(70)="Point Mark"
  ename$(71)="Attribute Definition"
  ename$(74)="Dimension, Angle"
  ename$(75)="Dimension"
  ename$(76)="Dimension, Diameter/Radius"
  ename$(77)="Dimension, Arc"
  ename$(78)="Dimension, Radius Progressive"
  ename$(79)="Dimension, Progressive"
  ename$(80)="Dimension, Chamfer"
  ename$(81)="Dimension, Coordinate"
  ename$(90)="Bitmap Image"
  ename$(92)="Double Line"
  ename$(93)="Double Curve"
  ename$(94)="Double Bezier"
  ename$(95)="Double Circle/Arc"
  ename$(96)="Double Elliptical Arc"
  ename$(97)="Double Ellipse"
  ename$(119)="Multiline Text"
  ename$(113)="MultiLine"
  ename$(114)="MultiLine Curve"
  ename$(115)="MultiLine Bezier"
  ename$(116)="MultiLine Circle/Arc"
  ename$(117)="MultiLine Ellipse"
  ename$(118)="MultiLine Elliptical Arc"
  ename$(119)="MultiLine Text (2D)"
  ename$(120)="MultiLine Text (3D)"
  ename$(122)="Solid Surface (version 24 +)"
return
« Last Edit: January 24, 2017, 04:18:23 PM by bdeck »

DrollTroll

  • Kindly Curmudgeon
  • Administrator
  • *****
  • Posts: 4091
Re: macro to enumerate types in current selection
« Reply #1 on: January 23, 2017, 01:03:04 PM »
Some newer extra types you may want to account for:

113=MultiLine
114=MultiLine Curve
115=MultiLine Bezier
116=MultiLine Circle/Arc
117=MultiLine Ellipse
118=MultiLine Elliptical Arc
119 = MultiLine Text (2D)
120 = MultiLine Text (3D)
122 = Solid Surface (version 24 and later)
2016 marks my 24th year in DesignCAD-Land!

bdeck

  • Hero Member
  • *****
  • Posts: 780
Re: macro to enumerate types in current selection
« Reply #2 on: January 23, 2017, 01:22:26 PM »
Thanks DT.
     Modified the OP.
bd

SFA

  • Full Member
  • ***
  • Posts: 227
  • *
    • Stanley Fyffe Associates
Re: macro to enumerate types in current selection
« Reply #3 on: January 24, 2017, 03:28:23 AM »
Thank you BDECK. This works well.

Stan
SEMPER IN EXCRETIA