Is possible on lisp to sum up the value and self update the MText of the no. of rebar of the dynamic block in above a line with selection? If there are no MText, no need to update.
Solved! Go to Solution.
Solved by ec-cad. Go to Solution.
Solved by ec-cad. Go to Solution.
Sorry, i am apologize that I got the wrong way to do this task.
I need to try to modify the block can measure multiple distance and resulting the rebar numbers. Thanks for your advice!
Count.lsp will work for a single set of either Vertical or Horizontal items.
Whatever is included in the 'Crossing' of the 2 points you pick will be copied in the
Horizontal direction. It adjusts the target points, based on original X,Y of each point chosen.
So, if the original info is oriented Horizontal - you get a copy that's Horizontal, and if the
original info is oriented Vertical - you get a copy that's Vertical.
You can include any 'lines' or points, circles, whatever is in the Crossing Window picks.
The program just makes a copy to the right, explodes items if they are 'Inserts,' (Blocks) leaves the
rest as it is. Exploding those Blocks, surfaces the embedded MTEXT's so they can be examined.
Then, the program changes the Properties of those items to be on Layer Temp. Next, it gathers
only the MTEXT items on Layer Temp, gets their text value, looks for a "(", and gets the numbers inside
the ( ), makes a sum of the (atoi value), string to integer. Once done with that, just removes the
items from the Temp layer, and zooms previous so you can pick the MTEXT item to update.
So, bottom line, should work for either Vert or Horiz.
ECCAD
For this sample drawing. You have the Vertical samples (to the right) of the Horizontal samples.
Since the Lisp has a 'constant' distance to the right that it copies to, you may need to increase
the distance to say, 32000 rather than the 16000 presently.
Try this on your new sample drawing with both Vertical and Horizontal layouts.
ECCAD
Thank you very much! The lisp works great on vertical and horizontal item!
Happy to help.
This may be the path to a solution, bit busy at moment its Christmas. A pick pick pick answer.
(defun c:wow ( / obj1 obj2 str txt)
(setq obj1 (vlax-ename->vla-object (car (nentsel "\nPick source text "))))
(setq obj2 (vlax-ename->vla-object (car (entsel "\nPick destination text "))))
(setq id (vlax-invoke-method (vla-get-Utility (vla-get-activedocument (vlax-get-acad-object))) 'GetObjectIdString obj1 :vlax-false))
(setq str (strcat "%<\\AcObjProp Object(%<\\_ObjId " id ">%).TextString>%"))
(vlax-put obj2 'textstring str)
(princ)
)
I have daisy chain attributes summing them to a field, so maybe can get the ID of the bar number. So method would be pick+pick+pick.
@ec-cad @Sea-Haven Thank you very much! I have update the .LSP with "Mtext" and "Text" version. Added Picking mode. Finally will zoom to the designate location.
Can't find what you're looking for? Ask the community or share your knowledge.