Author Topic: What is deference between these 2 blocks?  (Read 262 times)

0 Members and 1 Guest are viewing this topic.

HasanCAD

  • Swamp Rat
  • Posts: 1201
What is deference between these 2 blocks?
« on: September 05, 2017, 01:00:44 pm »
HI all
I have thee 2 block with the same name and all properties
but one ofthem is mirrored
why? and how to solve this issue?

Master_Shake

  • Swamp Rat
  • Posts: 1279
Re: What is deference between these 2 blocks?
« Reply #1 on: September 05, 2017, 02:15:21 pm »
A question which should be answered first, how did you arrive to this situation?

ronjonp

  • Needs a day job
  • Posts: 6403
Re: What is deference between these 2 blocks?
« Reply #2 on: September 05, 2017, 02:19:38 pm »
The incorrect text from the mirror is a result of MIRRTEXT being set to 1.
« Last Edit: September 05, 2017, 02:52:26 pm by ronjonp »

Windows 10 x64 - AutoCAD /C3D 2018

Custom Build PC

Crank

  • Swamp Rat
  • Posts: 1339
Re: What is deference between these 2 blocks?
« Reply #3 on: September 05, 2017, 02:30:14 pm »
When you list both blocks, you'll notice a difference of the extrusion direction relative to UCS. The blocks are not on the same UCS.
Z=-1 means that you look at that block from behind.

You can fix this with the ALIGN command.
You'll need 3 points:
- end of arc > other end of arc
- corner 1 > opposite of corner 1
- other corner > opposite of other corner

 Vault Professional 2017              /              Building Design Suite Ultimate 2017              /              Autocad PI

HasanCAD

  • Swamp Rat
  • Posts: 1201
Re: What is deference between these 2 blocks?
« Reply #4 on: September 06, 2017, 04:38:07 am »
A question which should be answered first, how did you arrive to this situation?
In fact this file I recives from our branch in another country. They making kiling mistakes like this and saying we are not profesional in AutoCAD same as you, Hassan please fixing errors.

HasanCAD

  • Swamp Rat
  • Posts: 1201
Re: What is deference between these 2 blocks?
« Reply #5 on: September 06, 2017, 04:40:06 am »
The incorrect text from the mirror is a result of MIRRTEXT being set to 1.
Thanks for your solution but when run the lisp the blocks moves to aother place

HasanCAD

  • Swamp Rat
  • Posts: 1201
Re: What is deference between these 2 blocks?
« Reply #6 on: September 06, 2017, 04:41:28 am »
When you list both blocks, you'll notice a difference of the extrusion direction relative to UCS. The blocks are not on the same UCS.
Z=-1 means that you look at that block from behind.

You can fix this with the ALIGN command.
You'll need 3 points:
- end of arc > other end of arc
- corner 1 > opposite of corner 1
- other corner > opposite of other corner
It is very good way, But these are 3 files with thounds of blocks with this error.

ronjonp

  • Needs a day job
  • Posts: 6403
Re: What is deference between these 2 blocks?
« Reply #7 on: September 06, 2017, 11:00:30 am »
When you list both blocks, you'll notice a difference of the extrusion direction relative to UCS. The blocks are not on the same UCS.
Z=-1 means that you look at that block from behind.

You can fix this with the ALIGN command.
You'll need 3 points:
- end of arc > other end of arc
- corner 1 > opposite of corner 1
- other corner > opposite of other corner
It is very good way, But these are 3 files with thounds of blocks with this error.
This seems to work with your example drawing:
Code - Auto/Visual Lisp: [Select]
  1. (defun c:foo (/ i)
  2.  ;; No locked layer check
  3.    (vlax-for b a
  4.      (if (and (= "AcDbBlockReference" (vla-get-objectname b))
  5.       (= "C1-T1" (vla-get-name b))
  6.       (setq i (vlax-get b 'normal))
  7.       (minusp (last i))
  8.  )
  9. (progn (vlax-put b 'normal (list (car i) (cadr i) (abs (caddr i))))
  10. )
  11.      )
  12.    )
  13.  )
  14.  (command "_.attsync" "_Name" "C1-T1")
  15.  (princ)
  16. )

Windows 10 x64 - AutoCAD /C3D 2018

Custom Build PC

HasanCAD

  • Swamp Rat
  • Posts: 1201
Re: What is deference between these 2 blocks?
« Reply #8 on: September 06, 2017, 11:22:07 am »
...
This seems to work with your example drawing:
...
Thnaks Ron
I devolped in another way
to get properties from the block then insert another one with same properties
but faced a bug in some blocks need to rotate and some no
I tried to inderstand how to rotate the block for example by pressing < or > put could not
So could you please help me in this step
Code - Auto/Visual Lisp: [Select]
  1. (defun c:BMI ( / b doc i l n o p r spc x y z )
  2.  spc (if (zerop (vla-get-activespace doc))
  3. (if (= (vla-get-mspace doc) :vlax-true)
  4.  (while t
  5.    (if (and
  6. (setq o (car (entsel)))
  7. (setq o (vlax-ename->vla-object o))
  8. (setq i (vlax-get o 'normal))
  9. (> 0 (nth 2 i))
  10. )
  11.    (progn
  12.      (setq p (vlax-get o 'InsertionPoint))
  13.      (setq l (vlax-get o 'layer))
  14.      (setq r (vlax-get o 'Rotation))
  15.      (setq x (vlax-get o 'XScaleFactor))
  16.      (setq y (vlax-get o 'YScaleFactor))
  17.      (setq z (vlax-get o 'ZScaleFactor))
  18.      (setq n (vlax-get-property o (if (vlax-property-available-p o 'EffectiveName) 'EffectiveName 'Name)))
  19.      (vl-catch-all-error-p (setq b (vl-catch-all-apply (function vla-InsertBlock) (list spc (vlax-3D-point p) n x y z (+ r 3.14159)))))
  20.      (vlax-put b 'layer l)
  21.      (command "_.attsync" "_Name" n)
  22.      (vla-delete o)
  23.      ))))

ronjonp

  • Needs a day job
  • Posts: 6403
Re: What is deference between these 2 blocks?
« Reply #9 on: September 06, 2017, 02:59:06 pm »
If you have many of these to do why are you picking each one manually? Give the code below a try .. although you're going to have to also account for the current attribute values too.
Code - Auto/Visual Lisp: [Select]
  1. (defun c:bmi (/ b doc i l n o p r spc x y z)
  2.      (if (= (vla-get-mspace doc) :vlax-true)
  3.      )
  4.      (vla-get-modelspace doc)
  5.    )
  6.  )
  7.  (while (and (setq o (car (entsel)))
  8.      (setq o (vlax-ename->vla-object o))
  9.      (setq i (vlax-get o 'normal))
  10.      (> 0 (nth 2 i))
  11. )
  12.    (progn (setq p (vlax-get o 'insertionpoint))
  13.   (setq l (vlax-get o 'layer))
  14.   (setq r (vlax-get o 'rotation))
  15.   (setq x (- (vlax-get o 'xscalefactor)))
  16.   (setq y (vlax-get o 'yscalefactor))
  17.   (setq z (vlax-get o 'zscalefactor))
  18.     o
  19.     (if (vlax-property-available-p o 'effectivename)
  20.       'effectivename
  21.       'name
  22.     )
  23.   )
  24.   )
  25.     (setq
  26.       b (vl-catch-all-apply (function vla-insertblock) (list spc (vlax-3d-point p) n x y z r))
  27.     )
  28.   )
  29.   (vlax-put b 'layer l)
  30.   (command "_.attsync" "_Name" n)
  31.   (vla-delete o)
  32.    )
  33.  )
  34.  (princ)
  35. )

Windows 10 x64 - AutoCAD /C3D 2018

Custom Build PC

HasanCAD

  • Swamp Rat
  • Posts: 1201
Re: What is deference between these 2 blocks?
« Reply #10 on: September 12, 2017, 11:48:43 am »
If you have many of these to do why are you picking each one manually? Give the code below a try .. although you're going to have to also account for the current attribute values too.

Thanks Ron for your value help

ronjonp

  • Needs a day job
  • Posts: 6403
Re: What is deference between these 2 blocks?
« Reply #11 on: September 12, 2017, 12:14:12 pm »
If you have many of these to do why are you picking each one manually? Give the code below a try .. although you're going to have to also account for the current attribute values too.

Thanks Ron for your value help
You're welcome :)

Windows 10 x64 - AutoCAD /C3D 2018

Custom Build PC