Recently read something from web that mentions the AutoLISP tblobjname would fail after the DIM Update command but the AutoLISP tblsearch work well instead in that case.
Unfortunately, it’s found not true. The AutoLISP functions both tblobjname and tblsearch work just fine in all the cases. The following are the simple test code and related output.
Command: C
CIRCLE Specify center point for circle or [3P/2P/Ttr (tan tan radius)]:
Specify radius of circle or [Diameter]:
Command: (tblobjname "block" "*D1")
nil
Command: (tblsearch "block" "*D1")
nil
Command: DIM
Dim: dia
Select arc or circle:
Enter dimension text <12.0884>:
Specify dimension line location or [Mtext/Text/Angle]:
Dim: *Cancel*
Command: (tblobjname "block" "*D1")
<Entity name: 7ffffb05b90>
Command: (tblsearch "block" "*D1")
((0 . "BLOCK") (2 . "*D1") (70 . 1) (10 0.0 0.0 0.0) (-2 . <Entity name: 7ffffb05c30>))
Command: DIM
Dim: upd
Select objects: all
2 found
Select objects:
Dim: *Cancel*
Command: (tblobjname "block" "*D1")
<Entity name: 7ffffb05b90>
Command: (tblsearch "block" "*D1")
((0 . "BLOCK") (2 . "*D1") (70 . 1) (10 0.0 0.0 0.0) (-2 . <Entity name: 7ffffb05d20>))
As can be seen, the difference is that the tblobjname AutoLISP function returns an entity name but the tblsearch returns a list! Maybe that got the guy confused. Anyway, if not clear about the situation, do a bit more research, please; if any good reasons behind the failure of the tblobjname and the success of the tblsearch, elaborate it a little bit, please.
The leading edge AutoCAD .NET Addin Wizard (AcadNetAddinWizard) provides various project wizards, item wizards, coders and widgets to help program AutoCAD .NET addins.
Posted by: |