Author Topic: "AutoCAD Mechanical 2012" in the dxf code "70", change the contact  (Read 3992 times)

0 Members and 1 Guest are viewing this topic.

rlxozzang

  • Guest
"AutoCAD Mechanical 2012" in the "_.dim1" command placed into the vertical dimension to try to change the value of the dxf 70 times, which change the value of any change sangeseon There's no actual screen? Do I need to try different ways meokenikeoleun? lisp code:
Code - Auto/Visual Lisp: [Select]
  1. (defun c: dim_Odinatexy_subst
  2.    (/ PTE: Dxfsubst ss elst ij)
  3.    (defun PTE: DxfSubst
  4.       (code new lst)
  5.       (if (assoc code lst)
  6.          (entmod (subst (cons code new) (assoc code lst) lst))
  7.          (entmod (append lst (list (cons code new))))
  8.       )
  9.    )
  10.    ;;----
  11.    (setq ss (ssget '((0. "dimension") (-4. "& =") (70. 6)))
  12.          i  -1
  13.    )
  14.    (repeat (sslength ss)
  15.       (setq elst (entget (ssname ss (setq i (1 + i)))))
  16.       (if (zerop (logand 64 (setq j (cdr (assoc 70 elst)))))
  17.          (setq j (+ j 64))
  18.          (setq j (- j 64))
  19.       )
  20.       (PTE: dxfsubst 70 j elst)
  21.    )
  22.    (princ)
  23. )

edit:kdub->code formatted and code=cadlisp-7
« Last Edit: June 28, 2012, 06:42:41 PM by Kerry »

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: "AutoCAD Mechanical 2012" in the dxf code "70", change the contact
« Reply #1 on: June 28, 2012, 06:46:08 AM »
Read this regarding formatting code in your posts.

rlxozzang

  • Guest
Re: "AutoCAD Mechanical 2012" in the dxf code "70", change the contact
« Reply #2 on: June 28, 2012, 07:15:52 PM »
Code - Auto/Visual Lisp: [Select]
  1. (defun DS:SubLayerMake (layName color / obj)
  2.         (setq obj (vla-add (vla-get-layers AcDoc) layName))
  3.         (setq idx (vla-get-TrueColor obj))
  4.         (vla-put-ColorIndex idx color)
  5.         (vla-put-TrueColor obj idx)
  6. )
. Practice..........................................................thanks Lee Mac

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: "AutoCAD Mechanical 2012" in the dxf code "70", change the contact
« Reply #3 on: June 29, 2012, 07:43:06 AM »
Since the first 6 values of Dimension group code 70 aren't bit-codes, I don't think you can filter for the Ordinate Dimensions using a bitwise masked-equals relational filter in the ssget filter list.

Consider this code:

Code - Auto/Visual Lisp: [Select]
  1. (defun c:dimordswitch ( / e i s x )
  2.     (if
  3.         (setq s
  4.             (ssget "_:L"
  5.                '(
  6.                     (0 . "DIMENSION")
  7.                     (-4 . "<OR")
  8.                         (70 . 006)
  9.                         (70 . 038)
  10.                         (70 . 070)
  11.                         (70 . 102)
  12.                         (70 . 134)
  13.                         (70 . 166)
  14.                         (70 . 198)
  15.                         (70 . 230)
  16.                     (-4 . "OR>")
  17.                 )
  18.             )
  19.         )
  20.         (repeat (setq i (sslength s))
  21.             (setq e (entget (ssname s (setq i (1- i))))
  22.                   x (assoc 70 e)
  23.             )
  24.             (entmod (subst (cons 70 (boole 6 64 (cdr x))) x e))
  25.         )
  26.     )
  27.     (princ)
  28. )

rlxozzang

  • Guest
Re: "AutoCAD Mechanical 2012" in the dxf code "70", change the contact
« Reply #4 on: July 01, 2012, 09:08:40 PM »
Since the first 6 values of Dimension group code 70 aren't bit-codes, I don't think you can filter for the Ordinate Dimensions using a bitwise masked-equals relational filter in the ssget filter list.

Consider this code:

Code - Auto/Visual Lisp: [Select]
  1. (defun c:dimordswitch ( / e i s x )
  2.     (if
  3.         (setq s
  4.             (ssget "_:L"
  5.                '(
  6.                     (0 . "DIMENSION")
  7.                     (-4 . "<OR")
  8.                         (70 . 006)
  9.                         (70 . 038)
  10.                         (70 . 070)
  11.                         (70 . 102)
  12.                         (70 . 134)
  13.                         (70 . 166)
  14.                         (70 . 198)
  15.                         (70 . 230)
  16.                     (-4 . "OR>")
  17.                 )
  18.             )
  19.         )
  20.         (repeat (setq i (sslength s))
  21.             (setq e (entget (ssname s (setq i (1- i))))
  22.                   x (assoc 70 e)
  23.             )
  24.             (entmod (subst (cons 70 (boole 6 64 (cdr x))) x e))
  25.         )
  26.     )
  27.     (princ)
  28. )
There is no change.

rlxozzang

  • Guest
Re: "AutoCAD Mechanical 2012" in the dxf code "70", change the contact
« Reply #5 on: July 01, 2012, 09:14:42 PM »
Inquiry

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: "AutoCAD Mechanical 2012" in the dxf code "70", change the contact
« Reply #6 on: July 02, 2012, 07:30:39 AM »
There is no change.

The code works for me  :?

rlxozzang

  • Guest
Re: "AutoCAD Mechanical 2012" in the dxf code "70", change the contact
« Reply #7 on: July 02, 2012, 07:42:33 AM »
There is no change.

The code works for me  :?
I am still "lisp" Please raseo a beginner! Sorry I offend you ... If you've