TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Amsterdamned on October 18, 2021, 11:42:11 AM
-
Hello everybody,
Long time ago that I was here for the last time. Forced to earn my money with revit those days.
I have a rare question, I got a dwg exported out of revit for automatization purpose.
Some inserts show in the Entget function a wrong values for the dxf 10 code for the insertion point when the extrusion is z negative , the 210 dxf code is (210 0.0 0.0 -1.0) then the x value of the block end the z value of the block 1 – the value.
For (10 -508.44 85162.0 -3350.0) instead of (10 508.44 85162.0 3350.0)
When (210 0.0 0.0 -1.0) instead of (210 0.0 0.0 1.0)
Why is that, I for sure don’t understand why the x value is inverted.
Can I count on that that it is persistent and act accordingly?
Thanks Bernd
-
The polyline is going in the reverse direction. Think of it as upside down. If you where to extrude it with a positive value it would go into the negative.
Use the following to reverse them to normal. the shape won't change. I don't know if the 10 codes will change. but seeing as the extrude acts when its reversed I have a hunch the 10 codes should be corrected.
;;----------------------------------------------------------------------------;;
;; Flips Backwards ploylines
(defun C:SWAP (/ SS)
(setq SS (ssget "_X" '((210 0.0 0.0 -1.0))))
(if (/= SS nil)
(progn
(prompt (strcat "\nEntities Swapped: " (itoa (sslength SS))))
(vl-cmdf "_.Mirror3d" SS "" "xy" "0,0,0" "y")
)
(prompt "\nNothing to Swap!")
)
(princ)
)
-
Another -
(defun c:flipblks
( / i s
) '(
(1.0 0.0 0.0 0.0)
(0.0 1.0 0.0 0.0)
(0.0 0.0 -1.0 0.0)
(0.0 0.0 0.0 1.0)
)
)
)
)
)
)
-
@Mod, please merge these threads -
https://www.theswamp.org/index.php?topic=57105
-
Lee, i get an error when i run your code
-
Lee, i get an error when i run your code
What is the error?