Perhaps David is correct in suggesting that you just purchase the part on Objects Online and be done with it. Help David along.
But how about a suggestion to help those who what to create parts on their own.
Our office made just such a part. James has a good start on the method to make the object be stretchy. There also are many other ways to make the part to get around other problems which will occur when making the part stretchy unless you know where they are. The easy way out is to make the part read a parameter that the user inputs. This number of courses will tell the control loop to send the object created in the subroutine along that number of times. Great way. Simple. Time consuming when grabbing the part from some other sheet and wanting to make more or less courses. As you have to open and type a new number every time you want more or less courses. Of course a crafty person could use the Object ID box to enter new numbers on the fly. This ID box is at the very bottom of the Info strip. Here you can adjust a single parameter without ever opening the Settings Box. Very useful for Door, window or room numbers as well.
But we are talking about a CMU coursing symbol. James is right about using the INT (B/CMU_size) to get the number of courses and the number of times the loop which will call the subroutine for the CMU block. He also has the right idea of using hotspot2 0,0 and hotspot2 0,B. I would add the two other hotspot corners as Hotspot2 A, 0 and Hotspot2 A,B. But where the object will get hung up and no longer be stretchy is when hotspots are no longer on the outer corners of the CMU symbol. It would be best to use the FRA command to create a part (last CMU unit) to fill the remaining distance. The FRA command returns the decimal value of the remainder used in the INT command earlier (B/CMU_size). Written as FRA (B/CMU_size). You cannot simply apply this value to a drawn 2D part as the last distance to go but you can then redefine the height of the CMU block if you are using a subroutine to define the object's shape.
If like our office, you chose to blast out twelve different CMU and brick symbols in thirty minutes, because GS could not include them in the AC library, as drawn 2D symbols and called them in the 2D script using the FRAGMENT2 x, 1 command then used the INT and FRA commands to run the number of courses you would need to use the MUL2 command on the last CMU unit to get it to fit (squish) the remaining distance assuming the "B" distance is not equal to the number of courses. Key thing to note here is distort only the CMU and not the mortar of the last course. If your 2D symbol is both CMU and mortar then the last course will have distorted mortar. Only distort the CMU. So when you apply the MUL2 command to the CMU unit remember to subtract the mortar height from the remaining distance. This remaining distance is the value from the FRA command. This might be--
RMG_distance=FRA (B/CMU_size)
MUL2 1, RMG_distance-3/8" ! 3/8" is mortar height
Distorting the last CMU block may seem very odd, but not when it makes the stretchyness of the object complete and the bounding hotspots have a spot to be found by the user later.
About making the last unit fill in as part of the symbol, my opinion is this makes the script complicated and opens the chance for a total loss of the drawing when the part is changed later or lost. I would recommend using separate parts for bond blocks, Lintels, reinforcing and horizontal reinforcing. Though these could be added to a part which is used to make CMU walls. Losing the part means a loss of the drawing. Lossing just one part of twelve is easier to recoup then one which does the work of twelve. Just a recommendation.
Also though the desire may be there to make the 2D symbol scripted versus drawn, lots of time is used to create this scripted object. The most important thing for our office is get the parts done easily and with options to complicate it later. For this object, the script is the most valuable part as the successful creation was used to create twelve other symbols which used the same process but different 2D images. The 2D scripted images would have taken a junior AC user lots of time to figure out. Our symbol script was worked out by someone with some experienced skill at GDL then handed to a beginner to continue developing the other symbols/parts. This gets the experienced person on to other tasks and beginner more confidence in using GDL and making symbols/parts.
HTH
Terrence Sturm, Architect
_______________
MBP OSX 10.15.4 Quad Core Intel i7 2.2hz
AC 17 build 5019
AC 22 build 7000
AC 23 build
AC 24 build 5000