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.
You can get the current value from a dynamic block as I can see shrink or stretch changes the values. You can use Lee-mac Dynamic Block functions, Dynamic Block Functions | Lee Mac Programming. So then add them up.
For a block showing (12)
(LM:GETDYNPROPS obj)
(("Distance1" . 3075.xxx-xxxxxxxx) ("Origin" 0.0 0.0 0.0) ("Spacing & no. of links" . "( ) 150") ("Bar Size" . 10.0) ("Origin" 1732.xxx-xxxxxxxx 511.194790271098 1.02868241965889e-05) ("Distance3" . 2108.xxx-xxxxxxxx) ("Text Location" . 6.15727179154933) ("Origin" -1.17073068395257e-06 100.000000122702 0.0) ("Text Angle" . 3.14159258347001) ("Origin" 960.222686269668 242.xxx-xxxxxxxx 1.02868241965889e-05))
: (/ 3075 150)
20
: (/ 2108 150)
14 is correct answer 14-2 ie edge gap.
So still confused getting the field string showed get a length of an object, so how is this relevant to any of the other objects making the block. Or the dynamic properties.
"\\pxqr;{\\T0.95;(%<\\AcObjProp.16.2 Object(%<\\_ObjId 1986975136 0>%).Length \\f \"%lu2%pr0%ct8[0.006667]\">%)}"
Sorry, I am not the creator of block. Only get attribute value of block and Mtext/ text, then update the Mtext eg. "16"ET16-200... update 16 is OK.
Can you provide some reference example/ location for me to write the lisp? Thank you.
@skchui6159 hi,
The error arises cause the data returns from (setq properties (LM:getdynprops blk)) is mixed.
e.g string, reals, list (points) and the (strcat) function accept only strings.
would you provide an example of what you want to do here?
post a sample dwg with before and after state.
Moshe
@Moshe-A Hi, Greeting. I want to add all number of in the blanket (integer) in the block/Mtext/text and then update the no. of rebars of the orginal text (left hand side before the text of "ET" and "T") after select the object.
I use the above lisp try to extracted the prop value. (It is my proposed step 1...)
Skhui696 is trying to add all the displayed numbers some are fields some are plain mtext. If its just make a new mtext then its sum the values, if its can change the values so final text is updated then a field sum made up of all objects is required. The issue I was having is that the individual dynamic block has a field that uses ".length" but the objects dont appear to have any dynamic parameters matching that length. So I could not even get the resulting field value eg 12. Its buried deep inside the dynamic block. So any ideas on how to get that value then summing them is the easy part.
ps I did manage to get the field string but I used nentsel to get at it.
I have an idea. Can use somewhere to copy and paste then explode. Also make them in a group, get the value? Final, erase the new items? But how the lisp can get the prop value of the block.
Here's my 5 cents. Yes, Copy, Explode, get sum, update original, remove copy..it's all here.
Try this one. Tested on your sample drawing.
Load or drag/drop into your drawing. Function call is COUNT. Pick a window around your layout,
then, pick the MTEXT at the far end.
Note: you cannot have items to the right of the rebar layout ~ 16000 units, that's where the
program makes a copy. It also makes a Layer called "TEMP". You may want to remove that.
Have fun with it.
ECCAD
Guys,
I tried a few hours to dig into the Dynamic block to grab the MTEXT. No go on my part.
I tried all the (assoc 330 / (assoc 360's - kept going back to the Block. Shows something in
XDICTIONARY ? Whatever that is. Gave up, made a Lisp to grab the rebar layout, copy / explode, remove
so it would surface those burried MTEXTS. Why are they burried so deep that I can't seem to get at them
is a mistery. Maybe someone here can explain how to get to them...
ECCAD
@skchui6159 hi,
Yesterday i have spent the whole day (from 9:00 to 24:00) trying to figure this out and i think
i crack it
(no very easy i admit) but it is still not finished (it will tonight) but i have two question for you:
1. Why do you use mtext and not keep using the dynamic block? it will be much easier if it will be not mixed.
2. the dynamic block is very sophisticated one (btw: its it yours?) contain about 20 visibility states, on your sample you use "() 150".
if you use others, it would help if you post sample.
Moshe
@Moshe-A This block not mine... But I need use it for working (Question 2)...Thank you for your help! Be relax.
For the question 1, because I think the dynamic block can not support multiple object in different distance to show the result. In the single result, the visibilty show the result directly (in custom spacing set it to eg. 225 c/c it shows 2T20-225...) . I think using lisp to select dynamic block to find the result is very complex (may be no solution....
).
@skchui6159 wrote:@Moshe-A Thank you for help! For my level, I think that may be I can not get any value of the block....
to use the block you can be at user normal level (you should explore it a bit)
but if you do not plan to use the block, there is no point for my lisp
@Moshe-A I use the this block for calulate the rebar number lots of time (user level). I know there are different visibilty mode in block. In multiple object, I can just use visibilty mode (eg.150) for my works. There are lot of visibilty mode... Single calculation of a rebar spacing, the dynamic blk can help. In the view of block properties, I can find the value of grid distance..., but I can not find the information of number of rebar...![]()
@skchui6159 wrote:@Moshe-A I use the this block for calulate the rebar number lots of time (user level). I know there are different visibilty mode in block. In multiple object, I can just use visibilty mode (eg.150) for my works. There are lot of visibilty mode... Single calculation of a rebar spacing, the dynamic blk can help. In the view of block properties, I can find the value of grid distance..., but I can not find the information of number of rebar...
Ya, if we could talk to the author of this block, it could save us a lot of time but since this is not possible you have to explore.
you could modified it to meet your needs though. if "() 150" serve you, then their is a place for the lisp but as i said, consider avoiding
using mtext cause the beauty of the block is the field in mtext that attached to a polyline which result the length according to stretching of the rebar.
Can't find what you're looking for? Ask the community or share your knowledge.