Author Topic: Ssget filter for mirrored multileader  (Read 440 times)

0 Members and 1 Guest are viewing this topic.

dexus

  • Bull Frog
  • Posts: 208
Ssget filter for mirrored multileader
« on: April 17, 2024, 04:13:22 AM »
Hi all,

I'm trying to select only mirrored multileaders, but I cant seem to get the ssget filter correct.

The normal of a multileader is set in the first appearance of dxf code 11 and if it is mirrored, it is set to (0.0 0.0 -1.0)

But other things like where the leaders are connected are also saved in dxf code 11.

If I try to match it directly it doesn't match anything because not all the 11's are the same:
Code - Auto/Visual Lisp: [Select]
  1. (ssget '((0 . "MULTILEADER") (11 0.0 0.0 -1.0)))

If I try to find all the non default normals it matches non-mirrored multileaders as well, because it matches the second 11 as non default:
Code - Auto/Visual Lisp: [Select]
  1. (ssget '((-4 . "<and") (0 . "MULTILEADER") (-4 . "!=") (11 0.0 0.0 1.0) (-4 . "and>")))

Is it possible to set an ssget filter for only the first appearance of 11?
Or is there another way to do this?

ribarm

  • Gator
  • Posts: 3279
  • Marko Ribar, architect
Re: Ssget filter for mirrored multileader
« Reply #1 on: April 17, 2024, 04:23:50 AM »
Try this :

Code - Auto/Visual Lisp: [Select]
  1. (setq ss (ssget (list (cons 0 "MULTILEADER") (list 11 0.0 0.0 -1.0) (cons -4 "<or") (list 11 -1.0 0.0 0.0) (list 11 1.0 0.0 0.0) (cons -4 "or>"))))
  2.  
« Last Edit: April 17, 2024, 04:35:36 AM by ribarm »
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

dexus

  • Bull Frog
  • Posts: 208
Re: Ssget filter for mirrored multileader
« Reply #2 on: April 17, 2024, 04:38:13 AM »
Yes, I found it. Thank you!
I did have to add the first 11 to the <or set as well:
Code - Auto/Visual Lisp: [Select]
  1.   '(
  2.     (0 . "MULTILEADER")
  3.     (-4 . "<or")
  4.       (11 -1.0  0.0  0.0)
  5.       (11  0.0 -1.0  0.0)
  6.       (11  0.0  0.0 -1.0)
  7.     (-4 . "or>")
  8.   )
  9. )
« Last Edit: April 19, 2024, 06:26:31 AM by dexus »

ribarm

  • Gator
  • Posts: 3279
  • Marko Ribar, architect
Re: Ssget filter for mirrored multileader
« Reply #3 on: April 17, 2024, 07:37:29 AM »
Yes, I found it. Thank you!
I did have to add the first 11 to the <or set as well:
Code - Auto/Visual Lisp: [Select]
  1.   '(
  2.     (0 . "MULTILEADER")
  3.     (-4 . "<or")
  4.       (11 -1.0  0.0  0.0)
  5.       (11  0.0 -1.0  0.0)
  6.       (11  0.0  0.0 -1.0)
  7.     (-4 . "or>")
  8.   )
  9. )

I think you are making mistake with this... There should be one 11 with positive 1.0... Look careful in my example...
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

dexus

  • Bull Frog
  • Posts: 208
Re: Ssget filter for mirrored multileader
« Reply #4 on: April 19, 2024, 06:25:58 AM »
You were right, my previous code was incorrect.
It selected only a mleader with the arrow on a specific side.

You're code selects nothing for me.
I attached an example drawing for more testing.

ribarm

  • Gator
  • Posts: 3279
  • Marko Ribar, architect
Re: Ssget filter for mirrored multileader
« Reply #5 on: April 19, 2024, 07:03:36 AM »
Try with this :

Code - Auto/Visual Lisp: [Select]
  1. (setq ss (ssget (list (cons 0 "MULTILEADER") (list 11 0.0 0.0 -1.0) (cons -4 "<or") (cons -4 "<or") (list 11 -1.0 0.0 0.0) (list 11 1.0 0.0 0.0) (cons -4 "or>") (cons -4 "<or") (list 13 -1.0 0.0 0.0) (list 13 1.0 0.0 0.0) (cons -4 "or>") (cons -4 "or>"))))
  2.  
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

dexus

  • Bull Frog
  • Posts: 208
Re: Ssget filter for mirrored multileader
« Reply #6 on: April 19, 2024, 07:13:06 AM »
Doesn't work in my version of AutoCAD, it is not able to select any mleader, does it work for you?
I'm using AuotCAD 2015.

ribarm

  • Gator
  • Posts: 3279
  • Marko Ribar, architect
Re: Ssget filter for mirrored multileader
« Reply #7 on: April 19, 2024, 07:29:28 AM »
Doesn't work in my version of AutoCAD, it is not able to select any mleader, does it work for you?
I'm using AuotCAD 2015.

Yes, you are right - it's not selecting in AutoCAD - I have 2022 version, but in BricsCAD it selects just what should - all of them from the right side - I have V23 where I tested, but on other PC I have V24 and I suppose it'll work and there...
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

ronjonp

  • Needs a day job
  • Posts: 7529
Re: Ssget filter for mirrored multileader
« Reply #8 on: April 20, 2024, 03:41:02 PM »
This works for me on your sample drawing.
Code - Auto/Visual Lisp: [Select]
  1. (sssetfirst nil (ssget "_X" '((0 . "MULTILEADER") (13 -1.0 0.0 0.0))))

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

ribarm

  • Gator
  • Posts: 3279
  • Marko Ribar, architect
Re: Ssget filter for mirrored multileader
« Reply #9 on: April 20, 2024, 04:09:33 PM »
Correct...
It selects in AutoCAD 2022 on my Laptop...
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

dexus

  • Bull Frog
  • Posts: 208
Re: Ssget filter for mirrored multileader
« Reply #10 on: April 22, 2024, 02:31:46 AM »
This works for me on your sample drawing.
Code - Auto/Visual Lisp: [Select]
  1. (sssetfirst nil (ssget "_X" '((0 . "MULTILEADER") (13 -1.0 0.0 0.0))))
Thanks ronjonp! This does work on my version of AutoCAD.
So switching to 13 instead of 11 does the trick, I guess since there is only one occurrence of this number it doesn't have any problems.

And ribarm, thanks for your input as well :-D

ronjonp

  • Needs a day job
  • Posts: 7529
Re: Ssget filter for mirrored multileader
« Reply #11 on: April 23, 2024, 05:29:43 PM »
This works for me on your sample drawing.
Code - Auto/Visual Lisp: [Select]
  1. (sssetfirst nil (ssget "_X" '((0 . "MULTILEADER") (13 -1.0 0.0 0.0))))
Thanks ronjonp! This does work on my version of AutoCAD.
...
Cheers!  :-)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
Re: Ssget filter for mirrored multileader
« Reply #12 on: April 23, 2024, 08:32:11 PM »
It should be noted that Mleaders which use a block instead of Mtext do not have the DXF 13 code.