Author Topic: DXF VALUE OF INSERTION POINT BLOCK WRONG IF (210 0.0 0.0 -1.0)  (Read 1542 times)

0 Members and 1 Guest are viewing this topic.

Amsterdamned

  • Mosquito
  • Posts: 5
DXF VALUE OF INSERTION POINT BLOCK WRONG IF (210 0.0 0.0 -1.0)
« 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 


mhupp

  • Bull Frog
  • Posts: 250
Re: DXF VALUE OF INSERTION POINT BLOCK WRONG IF (210 0.0 0.0 -1.0)
« Reply #1 on: October 18, 2021, 02:55:20 PM »
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.

Code: [Select]
;;----------------------------------------------------------------------------;;
;; 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)
)

Lee Mac

  • Seagull
  • Posts: 12905
  • London, England
Re: DXF VALUE OF INSERTION POINT BLOCK WRONG IF (210 0.0 0.0 -1.0)
« Reply #2 on: October 19, 2021, 02:25:26 PM »
Another -
Code - Auto/Visual Lisp: [Select]
  1. (defun c:flipblks ( / i s )
  2.     (if (setq s (ssget "_:L" '((000 . "INSERT"))))
  3.         (repeat (setq i (sslength s))
  4.             (vla-transformby (vlax-ename->vla-object (ssname s (setq i (1- i))))
  5.                 (vlax-tmatrix
  6.                    '(
  7.                         (1.0  0.0  0.0  0.0)
  8.                         (0.0  1.0  0.0  0.0)
  9.                         (0.0  0.0 -1.0  0.0)
  10.                         (0.0  0.0  0.0  1.0)
  11.                     )
  12.                 )
  13.             )
  14.         )
  15.     )
  16.     (princ)
  17. )
« Last Edit: October 19, 2021, 02:29:38 PM by Lee Mac »

Lee Mac

  • Seagull
  • Posts: 12905
  • London, England
Re: DXF VALUE OF INSERTION POINT BLOCK WRONG IF (210 0.0 0.0 -1.0)
« Reply #3 on: October 19, 2021, 02:26:50 PM »
@Mod, please merge these threads -
https://www.theswamp.org/index.php?topic=57105

Amsterdamned

  • Mosquito
  • Posts: 5
Re: DXF VALUE OF INSERTION POINT BLOCK WRONG IF (210 0.0 0.0 -1.0)
« Reply #4 on: October 21, 2021, 07:56:42 PM »
Lee, i get an error when i run your code

Lee Mac

  • Seagull
  • Posts: 12905
  • London, England
Re: DXF VALUE OF INSERTION POINT BLOCK WRONG IF (210 0.0 0.0 -1.0)
« Reply #5 on: October 22, 2021, 03:20:01 PM »
Lee, i get an error when i run your code

What is the error?