I'm trying to select each terminal (block name is HT0002) and modify attribute ("Tagstrip") value. This value is based on the location of the terminal. For example, the first terminal in the upper left corner would be 101.
Here is the process:
starting with retag_terminal function - select all blocks named HT0002; foreach terminal change attribute (tagstrip) value, but first build terminal value; pull sheet number value (which is 1); figure out which line terminal falls on (calls ladderrung function); the returned value will be a 2-digit number i.e. 01; combine sheet number & line number; change attribute number.
I like your condensed version, but I can figure out how to pass the value back to the main function. I tried assigning the line number back to endetail variable, but once the ladderrung function ends and passes back to the main endetail value changes back to this (setq endetail (assoc 10 (entget en)))
which is the terminal coordinates.