Author Topic: (100 . "AcDbAlignedDimension") in ssget fliter  (Read 8632 times)

0 Members and 1 Guest are viewing this topic.

beverage

  • Guest
(100 . "AcDbAlignedDimension") in ssget fliter
« on: April 10, 2014, 04:54:53 AM »
I found "(100 . "AcDbAlignedDimension")" is not affect in ssget fliter

(ssget '((0 . "DIMENSION")(100 . "AcDbAlignedDimension"))) this will selete all type of dimension(such as DbOrdinateDimension,AcDbArcDimension)
(ssget '((100 . "AcDbAlignedDimension"))) this will selete all type of entities


Did I write something wrong?
« Last Edit: April 10, 2014, 04:57:55 AM by beverage »

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: (100 . "AcDbAlignedDimension") in ssget fliter
« Reply #1 on: April 10, 2014, 05:40:15 AM »
What you are saying is not correct.

The only problem I see:
Code: [Select]
(ssget "_A" '((100 . "AcDbAlignedDimension"))) ; => Will also select rotated dimensions.My solution:
Code: [Select]
(ssget "_A" '((100 . "AcDbAlignedDimension") (-4 . "<NOT") (100 . "AcDbRotatedDimension") (-4 . "NOT>")))

beverage

  • Guest
Re: (100 . "AcDbAlignedDimension") in ssget fliter
« Reply #2 on: April 10, 2014, 09:10:34 PM »
It's strange.

I've tried the code in your solution, and tried one more time after your reply

Code - Auto/Visual Lisp: [Select]
  1. (ssget "_A" '((100 . "AcDbAlignedDimension") (-4 . "<NOT") (100 . "AcDbRotatedDimension") (-4 . "NOT>")))

will select nothing

It's really strange.I give up type judge during select, I plan to use member to judge if  (100 . "AcDbRotatedDimension") in the group code.

I guess it maybe caused by not only 1 (100 . "**")

((-1 . <图元名: 7ffffbb1030>)
(0 . "DIMENSION")
(330 . <图元名: 7ffffb0b820>)
(5 . "12620B")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "S_DETL_REIN")
(100 . "AcDbDimension")
(280 . 0) (2 . "*D442")
(10 45536.0 62515.1 0.0)
(11 45258.5 62647.4 0.0)
(12 0.0 0.0 0.0)
(70 . 33)
(1 . "")
(71 . 5)
(72 . 1)
(41 . 1.0)
(42 . 572.279)
(73 . 0)
(74 . 0)
(75 . 0)
(52 . 0.0)
(53 . 0.0)
(54 . 0.0)
(51 . 0.0)
(210 0.0 0.0 1.0)
(3 . "TSSD_50_50")
(100 . "AcDbAlignedDimension")
(13 44969.9 62622.6 0.0)
(14 45540.7 62582.4 0.0)
(15 0.0 0.0 0.0)
(16 0.0 0.0 0.0)
(40 . 0.0)
(50 . 0.0))

Thank you for your reply

I've just update from 2006 to 2012,and found lots new thing in alisp, I need some time ,I think.
« Last Edit: April 10, 2014, 09:17:11 PM by beverage »

owenwengerd

  • Bull Frog
  • Posts: 451
Re: (100 . "AcDbAlignedDimension") in ssget fliter
« Reply #3 on: April 10, 2014, 09:48:01 PM »
AutoCAD and Bricscad may work differently in that regard.

beverage

  • Guest
Re: (100 . "AcDbAlignedDimension") in ssget fliter
« Reply #4 on: April 10, 2014, 10:27:06 PM »
thank you, owenwengerd!

Sorry, I didn't heard about Bricscad , I and my team use AutoCAD all the time.

we discus both Bricscad and AutoCAD here? or only Bricscad ?

apology for my bad english.

I did some further test ,

When I using the
Code - Auto/Visual Lisp: [Select]
  1. (ssget '((0 . "LWPOLYLINE")  (10 47045.6 62081.2)))

It didn't work too, so I guess not only one group code can't be used in ssget fliter
« Last Edit: April 10, 2014, 10:30:43 PM by beverage »

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: (100 . "AcDbAlignedDimension") in ssget fliter
« Reply #5 on: April 11, 2014, 03:59:14 AM »
AutoCAD and Bricscad may work differently in that regard.
For obvious reasons I keep forgetting to mention that. Thanks.

owenwengerd

  • Bull Frog
  • Posts: 451
Re: (100 . "AcDbAlignedDimension") in ssget fliter
« Reply #6 on: April 11, 2014, 09:41:50 AM »
we discus both Bricscad and AutoCAD here? or only Bricscad ?

Both are discussed here, and most Lisp code works the same in both, but not always. This just happens to be a case where the platform matters.

Lee Mac

  • Seagull
  • Posts: 12913
  • London, England
Re: (100 . "AcDbAlignedDimension") in ssget fliter
« Reply #7 on: April 12, 2014, 09:05:50 AM »
You could alternatively use the following ssget filter list to include only Aligned dimensions:

Code: [Select]
(
    (0 . "DIMENSION")
    (-4 . "<OR")
        (70 . 001)
        (70 . 033)
        (70 . 065)
        (70 . 097)
        (70 . 129)
        (70 . 161)
        (70 . 193)
        (70 . 225)
    (-4 . "OR>")
)

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: (100 . "AcDbAlignedDimension") in ssget fliter
« Reply #8 on: April 12, 2014, 01:39:20 PM »
Or:
Code: [Select]
(ssget "_A" ((0 . "DIMENSION") (-4 . "&") (70 . 1)))

Lee Mac

  • Seagull
  • Posts: 12913
  • London, England
Re: (100 . "AcDbAlignedDimension") in ssget fliter
« Reply #9 on: April 12, 2014, 02:05:13 PM »
Or:
Code: [Select]
(ssget "_A" ((0 . "DIMENSION") (-4 . "&") (70 . 1)))

Unfortunately, DXF group 70 for dimensions is not truly bit-coded - I believe your code would also select Diameter & Angular 3-Point dimensions, in addition to Aligned dimensions.

Lee Mac

  • Seagull
  • Posts: 12913
  • London, England
Re: (100 . "AcDbAlignedDimension") in ssget fliter
« Reply #10 on: April 12, 2014, 02:44:56 PM »
For a more functional approach, perhaps something like:

Code: [Select]
(defun dim-filter ( typ )
    (append
       '((0 . "*DIMENSION") (-4 . "<OR"))
        (mapcar '(lambda ( x ) (cons 70 (+ typ x))) (bit-combinations '(32 64 128)))
       '((-4 . "OR>"))
    )
)

(defun bit-combinations ( l / foo bar )
    (defun foo ( l r )
        (if (and l (< 1 r))
            (append (mapcar '(lambda ( x ) (+ (car l) x)) (foo (cdr l) (1- r))) (foo (cdr l) r))
            l
        )
    )
    (defun bar ( l r )
        (if (< 0 r) (append (bar l (1- r)) (foo l r)))
    )
    (cons 0 (bar l (length l)))
)

Hence, for aligned dimensions:
Code: [Select]
_$ (dim-filter 1)
((0 . "*DIMENSION") (-4 . "<OR") (70 . 1) (70 . 33) (70 . 65) (70 . 129) (70 . 97) (70 . 161) (70 . 193) (70 . 225) (-4 . "OR>"))

kruuger

  • Swamp Rat
  • Posts: 633
Re: (100 . "AcDbAlignedDimension") in ssget fliter
« Reply #11 on: April 12, 2014, 04:49:56 PM »
For a more functional approach, perhaps something like:

Code: [Select]
(defun dim-filter ( typ )
    (append
       '((0 . "*DIMENSION") (-4 . "<OR"))
        (mapcar '(lambda ( x ) (cons 70 (+ typ x))) (bit-combinations '(32 64 128)))
       '((-4 . "OR>"))
    )
)

(defun bit-combinations ( l / foo bar )
    (defun foo ( l r )
        (if (and l (< 1 r))
            (append (mapcar '(lambda ( x ) (+ (car l) x)) (foo (cdr l) (1- r))) (foo (cdr l) r))
            l
        )
    )
    (defun bar ( l r )
        (if (< 0 r) (append (bar l (1- r)) (foo l r)))
    )
    (cons 0 (bar l (length l)))
)

Hence, for aligned dimensions:
Code: [Select]
_$ (dim-filter 1)
((0 . "*DIMENSION") (-4 . "<OR") (70 . 1) (70 . 33) (70 . 65) (70 . 129) (70 . 97) (70 . 161) (70 . 193) (70 . 225) (-4 . "OR>"))
interesting :) is it possible to get only Rotated dims ?
thanks
kruuger

Lee Mac

  • Seagull
  • Posts: 12913
  • London, England
Re: (100 . "AcDbAlignedDimension") in ssget fliter
« Reply #12 on: April 12, 2014, 05:22:51 PM »
interesting :) is it possible to get only Rotated dims ?

Thanks kruuger  :-)

For Rotated Dimensions, you should be able to use:
Code: [Select]
(ssget (dim-filter 0))
Reference

kruuger

  • Swamp Rat
  • Posts: 633
Re: (100 . "AcDbAlignedDimension") in ssget fliter
« Reply #13 on: April 12, 2014, 05:47:03 PM »
interesting :) is it possible to get only Rotated dims ?

Thanks kruuger  :)

For Rotated Dimensions, you should be able to use:
Code: [Select]
(ssget (dim-filter 0))
Reference
A W E S O M E !!! I can improve my few tools.
thank you
kruuger

Lee Mac

  • Seagull
  • Posts: 12913
  • London, England
Re: (100 . "AcDbAlignedDimension") in ssget fliter
« Reply #14 on: April 12, 2014, 06:39:51 PM »
A W E S O M E !!! I can improve my few tools.
thank you
kruuger

You're most welcome kruuger!  :-)

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: (100 . "AcDbAlignedDimension") in ssget fliter
« Reply #15 on: April 14, 2014, 10:31:21 AM »
Or:
Code: [Select]
(ssget "_A" ((0 . "DIMENSION") (-4 . "&") (70 . 1)))

Unfortunately, DXF group 70 for dimensions is not truly bit-coded - I believe your code would also select Diameter & Angular 3-Point dimensions, in addition to Aligned dimensions.
Right, I should checked the documentation. It is a group code with a 'history'.
Strange that AutoCAD doesn't support filtering for group code 100.

Alternative filtering for gc 70:
Code: [Select]
(ssget "_A" '((0 . "DIMENSION") (-4 . "<NOT") (-4 . "&") (70 . 7) (-4 . "NOT>")))                     ; 0
(ssget "_A" '((0 . "DIMENSION") (-4 . "&") (70 . 1) (-4 . "<NOT") (-4 . "&") (70 . 6) (-4 . "NOT>"))) ; 1
(ssget "_A" '((0 . "DIMENSION") (-4 . "&") (70 . 2) (-4 . "<NOT") (-4 . "&") (70 . 5) (-4 . "NOT>"))) ; 2
(ssget "_A" '((0 . "DIMENSION") (-4 . "&") (70 . 1) (-4 . "&") (70 . 2)))                             ; 3
(ssget "_A" '((0 . "DIMENSION") (-4 . "&") (70 . 4) (-4 . "<NOT") (-4 . "&") (70 . 3) (-4 . "NOT>"))) ; 4
(ssget "_A" '((0 . "DIMENSION") (-4 . "&") (70 . 1) (-4 . "&") (70 . 4)))                             ; 5
(ssget "_A" '((0 . "DIMENSION") (-4 . "&") (70 . 2) (-4 . "&") (70 . 4)))                             ; 6


Lee Mac

  • Seagull
  • Posts: 12913
  • London, England
Re: (100 . "AcDbAlignedDimension") in ssget fliter
« Reply #16 on: April 14, 2014, 05:09:46 PM »
Alternative filtering for gc 70:
Code: [Select]
...

Interesting approach roy  :-)

beverage

  • Guest
Re: (100 . "AcDbAlignedDimension") in ssget fliter
« Reply #17 on: April 14, 2014, 11:12:08 PM »
thank you for all replies

my program will handle aligneddimension and rotateddimension in two diff. ways ,and don't accept other dimension types, so I think using ssget's fliter is not a good way for my goal.

I just feel strange about AutoCAD don't support filtering for group code 100.

I'm using "member" to get the dimension types.

BTW, Lee, you'r very very famous in Chinese lisp writers

Lee Mac

  • Seagull
  • Posts: 12913
  • London, England
Re: (100 . "AcDbAlignedDimension") in ssget fliter
« Reply #18 on: April 15, 2014, 04:38:33 PM »
BTW, Lee, you'r very very famous in Chinese lisp writers

I'm flattered to hear that!  :-)