- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello guys
long time lurker, first time poster.
as part of a bigger automation process, im trying to replace a sewer flow direction symbol with a dynamic version of the same, with attributes containing diameter information(DIA), and heights on both sides (BOBL and BOBR)
what i like to happen is the following
-replace old block (L_VHR) with dynamic block(SRI-STROOMRICHTING-SO) (same layer)
-if rotation of new block is between 90 and 270 degrees, rotate 180 degrees and flip (Flip state1)
-get a prompt to click on the texts to replace BOBL, DIA and BOBR (and remove the clicked text)
if possible also the following:
-click a line, set Distance1 and Distance2 to (1/2*length - 2,5)
so for a line of 50m length, Distance 1 and 2 would be 22,5m (1/2 * 50 -2,5)
-remove all (remaining) texts from the drawing
i managed the replacing of the blocks part, and also found text to attribute lisps. but i cant find a way to merge these, or have the attributes preset so you dont have to click so much, and also have no clue how to include the other parts.
i think(know) this all is just a bit above my level of understanding of autoLISP to figure out on my own, so could anyone help me with this?
what i have so far to replace the block is the following, derived from code of Kent1Cooper
(defun Vervangstroomrichting (/ ss n edata)
(command "-INSERT" "F:/LOCATION/SRI-STROOMRICHTING-SO.dwg") (command)
(if (setq ss (ssget "_X" '((2 . "L_VHR"))))
(repeat (setq n (sslength ss))
(setq edata (entget (ssname ss (setq n (1- n)))))
(entmod (subst '(2 . "SRI-STROOMRICHTING-SO") '(2 . "L_VHR") edata))
))
(command "_.attsync" "_name" "SRI-STROOMRICHTING-SO")
)
base drawing looks like this
at the point of this lisp, i will have replaced the circle and square blocks with a dynamic one with an added attribute of the red text (already got this figured out)
thanks in advance
Solved! Go to Solution.