@DC-MWA wrote:
DEC2 selects the first dim and changes the linetype. DET selects the second dim, and turns the line off.
Two clicks, one routine. DEC2 and DET combined.
Awesome!!! just sayin... 🙂
Try this [with both routines and the CENTER2 linetype already loaded in the drawing]:
(defun C:TEST () (C:DEC2) (C:DET))
You can pick anywhere on each Dimension involved, closer to their shared end than to each one's other end. If you pick on their overlapping extension lines, it gives you control over which gets the linetype assigned. It's easier for the second command to pick on the dimension line or arrowhead or text, so you don't need to specify again which Dimension for that. Or, if you have the LTGAPSELECTION System Variable set to 0, and the overlapping is visible enough [newer versions of AutoCAD] and the gaps big enough, you can pick on the second one's extension line within one of the gaps in the other's that got the linetype assigned.
I'm trying to figure whether there's a way to pick once on overlapping extension lines and achieve that result, or just do the linetype thing if there's only one Dimension there [it would able to tell -- an advantage over the TEST command above]. But here's the complication: To select one thing, as both those routines do, they use (entsel), and part of what that returns is the point at which you picked. That's essential to figuring out which "end" of the Dimension you're at, to determine whether extension line 1 or 2 should be altered. To select more than one thing would require (ssget), and while there's an :E selection mode that would see everything at the pick point, so two such Dimensions could be selected with one pick, the return from (ssget) does not include anything about where that pick was. But (ssnamex) can pull that information, so I'm investigating an approach using that.
If that works out, it would only work reliably when the extension lines are the same length and overlap over their entire length, because you would have no control over which of them got the linetype assigned and which got suppressed, which you do have control over with the two-pick scenario in the TEST command above.
Kent Cooper, AIA