I used to work at a place that when you inserted a block be it a valve, flanges, or any inline component you would clock on the button for the item you wanted and the prompt would ask "pick line to insert on" or something close. You would select your line and the it would insert the block and break the line.
Now the fun part. Where I am working at now not all the blocks are nowhere near the same size. So I will need to modify the command to work with about 50+ different symbols.
break down of whats needed
1. type in command
2. pick line to insert block
3. insert block
4. break line
5. close command....
Solved! Go to Solution.
Solved by Lee_Mac. Go to Solution.
Lee one question. I have been looking thru the routine and would like to put a default black name.
the name of the block is "inlfuz"
Where would that go in the routine...
That was it. works everytime all the time.
Excellent - glad to hear it!
Lee one question. I have been looking thru the routine and would like to put a default black name.
the name of the block is "inlfuz"
Where would that go in the routine...
You can call the main function with your own custom program:
(defun c:inlfuz ( / *error* blk dwg ins ) (setq blk "inlfuz") (defun *error* ( msg ) (LM:endundo (LM:acdoc)) (if (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*")) (princ (strcat "\nError: " msg)) ) (princ) ) (cond ( (= 4 (logand 4 (cdr (assoc 70 (tblsearch "layer" (getvar 'clayer)))))) (princ "\nCurrent layer locked.") ) ( (not (or (tblsearch "block" (setq dwg blk)) (setq dwg (findfile (strcat blk ".dwg"))))) (princ (strcat "\nBlock \"" blk "\" not found.")) ) ( (setq ins (getpoint "\nSpecify point for block: ")) (LM:startundo (LM:acdoc)) (LM:AutoBlockBreak (vlax-vla-object->ename (vla-insertblock (vlax-get-property (LM:acdoc) (if (= 1 (getvar 'cvport)) 'paperspace 'modelspace)) (vlax-3D-point (trans ins 1 0)) dwg 1.0 1.0 1.0 (angle '(0.0 0.0 0.0) (trans (getvar 'ucsxdir) 0 (trans '(0.0 0.0 1.0) 1 0 t) t)) ) ) (= "ON" (getenv "LMac\\ABBRotation")) ) (LM:endundo (LM:acdoc)) ) ) (princ) )
Simply copy the above code on a new line at the end of my AutoBlockBreak program file, and call the program with 'inlfux' (or whatever command you wish to use)
This is indeed the route that some drawing offices follow - some use wipeouts, others use solids/traces with the colour set to 255,255,255. The main obstacle with using this method are plotting issues in which the wipeout or solid is plotted as a solid black object.
But, yes - a good suggestion
Lee
Lee,
This code works great on my valve blocks, but not so good on my flange blocks. It does not break my flanges where I would like them to. The flange on the left is how yours does it but I need it to look like the flange on the right. Also, I have to shut off rotation because it will rotate the flange 90 degrees. Is there a way you can define which way the rotation of the blocks is?
Dave
Lee,
This code works great on my valve blocks, but not so good on my flange blocks. It does not break my flanges where I would like them to. The flange on the left is how yours does it but I need it to look like the flange on the right. Also, I have to shut off rotation because it will rotate the flange 90 degrees. Is there a way you can define which way the rotation of the blocks is?
Hi Dave,
As briefly noted on my site, the method used by the program to trim the objects surrounding the block is to obtain the dimensions of the rectangular bounding box of the block at zero rotation, transform this bounding box to account for the block rotation, scale and orientation, and then test for intersections between the bounding box and a selection set of the surrounding objects.
This method has the advantage of being relatively quick and requiring no user input to determine the break points, however, since the rectangular bounding box is used, this method assumes that the surrounding objects should be trimmed level with the extremeties of the block - which is great for convex blocks, but does not always produce the desired result for blocks with concave sections - this is unfortunately an inherent restriction of the program.
Regarding the block rotation, simply rotating the objects in your block definition should easily resolve this problem (i.e. the block at zero rotation should be how you want it to appear on a horizontal line).
I hope this helps.
Lee
To make the cutting box large enough,
you might need to use a 'convex hull'
info of which is also at LeeMac's, etal.