Author Topic: compare number of texts between 2 blocks  (Read 1575 times)

0 Members and 1 Guest are viewing this topic.

serge_c

  • Newt
  • Posts: 39
compare number of texts between 2 blocks
« on: January 09, 2015, 06:56:04 AM »
For a good programmer, it's not gonna be a problem :
1)to compare number of texts between 2 blocks , if it's different numbers to stop the opperation (show allert ), if is equal to go for the next step ,I want to check the numbers because ,the software which make it, sometimes make it different, but the equality is very important, in final I have to summ each number from As1 with his oposite from As3 and duble sum.
2)explode the WMF files , it's work as well as for blocks , I tried with one lisp for block(successful), I'll write it down
3)rotate all text horizontal like a make it in "explode example"
4) final step , I want select the text and trasnfort it in attributes, and transform attributes in block As1 ( one block) AS3 (other block)
I want it blocks because after that I export it to excell and allready there I will make the formula (As1+As3)*2 , and I will import it back (Attout, Attin)
« Last Edit: January 10, 2015, 07:57:47 AM by sergiu_ciuhnenco »

serge_c

  • Newt
  • Posts: 39
Re: 4 steps, Need Help with some lisp code
« Reply #1 on: January 09, 2015, 06:56:42 AM »
Code: [Select]
(defun C:ACISPrep (/ AllBlocks SolOnly )
(setvar "qaflags" 1)
(setq AllBlocks (ssget "X" (list (cons 0 "INSERT"))))
(while (/= AllBlocks nil)
(progn
(command "_.explode" AllBlocks "")
(setq AllBlocks (ssget "X" (list (cons 0 "INSERT"))))
);progn
);while
(setq SolOnly (ssget "X" '((0 . "3DSOLID"))))
(command "_.erase" "all" "R" SolOnly "")
(setvar "qaflags" 0)
(princ)
);end ACISPrep

This is the Explode lisp .May be will help you
« Last Edit: January 09, 2015, 08:58:40 AM by CAB »

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: 4 steps, Need Help with some lisp code
« Reply #2 on: January 09, 2015, 09:00:26 AM »
Welcome to the Swamp.
What I will help with is a more meaningful subject title.  8)
No time this morning but I will check back later today.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

serge_c

  • Newt
  • Posts: 39
Re: compare number of texts between 2 blocks
« Reply #3 on: January 10, 2015, 07:57:05 AM »
I write second and third step :
Code: [Select]
(defun c:xxx(/ bSet *error* )
  (setvar "qaflags" 1)
  (while(setq bSet(ssget "_X" '((0 . "INSERT"))))
    (command "_.explode" bSet "")
    ); end while
  (repeat 3(command "-purge" "all" "" "n"))
  (setvar "qaflags" 0)
(princ)
 (vl-load-com);Load Activex Support
    (defun *error* (s)
     (if adoc (vla-endundomark adoc))
  (if (not (member s '("Function cancelled" "quit / exit abort")))
      (princ (strcat "\n---->Error:" s))
  )
  (princ)
 )
 (setq adoc (vla-get-activedocument (vlax-get-acad-object)))
 (vla-startundomark adoc)
 (if
     (and
      (setq sset (ssget "X" '((0 . "TEXT,MTEXT"))))
   (setq value 0)
  )
  (progn
      (if (< value 0)
       (*error* "Negative Values Not Allowed")
    (progn
        (repeat (setq i (sslength sset))
         (setq en (vlax-ename->vla-object (ssname sset (setq i (1- i)))))
      (if (vlax-write-enabled-p en)
          (vlax-put-property en 'Rotation (DTR value))
      )
     )
    )
   )
  )
 )
 (vla-endundomark adoc)
 (princ))
 ;;Sub function for Convert Degree to Radians;;
 (defun DTR (a)
     (* pi (/ a 180.0))
)
can somebody help me with first and fourth