TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Amsterdamned on October 19, 2021, 05:32:43 AM
-
Hello,
my last post got me nowhere, so i try to explain differently.
I have some export out of revit where in need to create some data from I cannot do in revit, complicated to explain.
It is for prefab fire sprinkler systems, I need to create a xlm based file with instructions for my customers own system should be straight forward I thought but I run into some basic problems.
But I run into a snag, some blocks are showing wrong dxf 10 result for the insertion point, whenever dxf 210 is not (0.0 0.0 1.0)
Some are with 210 (0.0 0.0 -1.0) the it is maybe to solve with a 3d mirror but sprinkler systems also can run with a slope, then it is more complicated.
But the property dialog box in acad and the list command show the right results.
with entget:
Select object: ((-1 . <Entity name: 7ff6af226cf0>) (0 . "INSERT") (330 .
<Entity name: 7ff6af291f00>) (5 . "27AF") (100 . "AcDbEntity") (67 . 0) (410 .
"Model") (8 . "P-PIPE") (62 . 150) (100 . "AcDbBlockReference") (2 .
"NLRS_65_PIF_UN_Lassok_gen - Lassok_draad-17552420-_3D - bernd_bauer_") (10
2159.88 88008.3 -3350.0) (41 . 1.0) (42 . 1.0) (43 . 1.0) (50 . 0.0) (70 . 0)
(71 . 0) (44 . 0.0) (45 . 0.0) (210 0.0 0.0 -1.0))
with list
BLOCK REFERENCE Layer: "P-PIPE"
Space: Model space
Color: 150 Linetype: "BYLAYER"
Handle = 27af
Block Name: "NLRS_65_PIF_UN_Lassok_gen - Lassok_draad-17552420-_3D -
bernd_bauer_"
at point, X=-2159.8771 Y=88008.3131 Z=3350.0000
X scale factor: 1.0000
Y scale factor: 1.0000
Z scale factor: 1.0000
Extrusion direction relative to UCS:
X= 0.0000 Y= 0.0000 Z= -1.0000
Scale uniformly: No
Allow exploding: Yes
how is this possible? where does acad get the right information from isf not the entget function?
So my question is, how can I retrieve those “correct” results?
-
Well if you would have respond to the other posts. I would have suggest using the trans function then.
https://documentation.help/AutoCAD-ALISP-VLISP/WS73099cc142f4875516d84be10ebc87a53f-79d0.htm
-
the 3d mirror does not work . its not a polyline but an insert. i tried the trans function as well, but does not change a thing.
-
(trans '(2159.88 88008.3 -3350.0) '(0.0 0.0 -1.0) 0) => (-2159.88 88008.3 3350.0)
-
I get that the 3d mirror didn't work. kinda glanced over inserts thinking you meant insert point and not blocks. (my bad)
This should get you to where you need to be.
(defun C:trans (/ ss en pt)
(if (setq ss (ssget))
(foreach en (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))
(if (equal '(210 0.0 0.0 -1.0) (assoc 210 (entget en)))
(setq pt (trans (cdr (assoc 10 (entget en))) '(0.0 0.0 -1.0) 0))
(setq pt (cdr (assoc 10 (entget en))))
)
)
)
(princ)
)
-
thanks! i never used trans other than with the 0 and 1 freature! that works!