Author Topic: Arc Text Editor  (Read 7530 times)

0 Members and 1 Guest are viewing this topic.

DanB

  • Bull Frog
  • Posts: 367
Arc Text Editor
« on: October 07, 2004, 09:26:37 AM »
Does anyone have a LISP that will allow me to select a large number of Arc Text objects and globally change the Text style? Currently, I can select all of the arc text but must change the text styles individually.

thanks,

Dan

Mark

  • Custom Title
  • Seagull
  • Posts: 28753
Arc Text Editor
« Reply #1 on: October 07, 2004, 09:51:09 AM »
What do you get when you run this?
Code: [Select]

(assoc 7 (entget (car (entsel "\nSelect Curve Text: "))))
TheSwamp.org  (serving the CAD community since 2003)

Mark

  • Custom Title
  • Seagull
  • Posts: 28753
Arc Text Editor
« Reply #2 on: October 07, 2004, 10:00:36 AM »
Or better yet, what does this return?
Code: [Select]

(entget (car (entsel "\nSelect Curve Text: ")))
TheSwamp.org  (serving the CAD community since 2003)

DanB

  • Bull Frog
  • Posts: 367
Arc Text Editor
« Reply #3 on: October 07, 2004, 10:08:52 AM »
Command:
Command: (assoc 7 (entget (car (entsel "\nSelect Curve Text: "))))
Select Curve Text: (7 . "L70")
Command:
Command: *Cancel*

it would probably help to mention these were created with arc labels in LDD 2004. I do not have access (read-only) to the network settings of these labels. The arc text is actually AEC_CURVETEXT. This is a special case, otherwise I would just change the label settings and update them. After some discusion this morning it looks like we will just relabel most of these with good ole MTEXT because of space restrictions along the arcs. Thanks for looking into this so soon Mark (and anyone else who may be wracking their brain on this). This new job keeps me soo busy, I miss having time to lurk here at the swamp.

Thanks
Dan

DanB

  • Bull Frog
  • Posts: 367
Arc Text Editor
« Reply #4 on: October 07, 2004, 10:10:30 AM »
Command: rea
REGENALL Regenerating model.

Command: (entget (car (entsel "\nSelect Curve Text: ")))

Select Curve Text: ((-1 . <Entity name: 7efe3a08>) (0 . "AEC_CURVETEXT") (330 .
<Entity name: 7ef9ec10>) (5 . "D5C9") (100 . "AcDbEntity") (67 . 0) (410 .
"Model") (8 . "TXT-LABELS") (100 . "AecDbCurveText") (7 . "L70") (40 . 4.2) (71
. 0) (1 . " AL=40.21'") (50 . 0.5) (2 . "R=25.00'\r\nDel=92°08'53\"") (51 .
0.5) (360 . <Entity name: 7efa0910>) (52 . 4.66462) (53 . 6.2729) (54 .
5.46876) (55 . 0.0) (56 . 25.0) (10 738028.0 1.41677e+006 0.0) (11 738045.0
1.41675e+006 0.0) (12 0.0 0.0 1.0))

Command: *Cancel*

Command: *Cancel*

................results of second option

Mark

  • Custom Title
  • Seagull
  • Posts: 28753
Arc Text Editor
« Reply #5 on: October 07, 2004, 10:14:36 AM »
So it this little project a "no go"?

What about creating MTEXT from the arc text?
TheSwamp.org  (serving the CAD community since 2003)

DanB

  • Bull Frog
  • Posts: 367
Arc Text Editor
« Reply #6 on: October 07, 2004, 10:18:12 AM »
Can you do that? Create MTXT from the Arc Text? That could be very useful...

Mark

  • Custom Title
  • Seagull
  • Posts: 28753
Arc Text Editor
« Reply #7 on: October 07, 2004, 10:20:10 AM »
Quote from: DanB
Can you do that?

what........ are you kidding! Of course. :D

check back around lunch time.
TheSwamp.org  (serving the CAD community since 2003)

Mark

  • Custom Title
  • Seagull
  • Posts: 28753
Arc Text Editor
« Reply #8 on: October 07, 2004, 11:41:27 AM »
quick-n-dirty
Code: [Select]


(defun make-txt (str pt / txt_ent)
  (if
(entmake
 (list
'(0 . "MTEXT")
'(100 . "AcDbEntity")
(cons 8 (getvar "clayer"))
'(100 . "AcDbMText")
(cons 10 pt)
(cons 40 (getvar "textsize"))
'(71 . 1)
'(72 . 5)
(cons 1 str)
(cons 7 (getvar "textstyle"))
'(73 . 1)
)
 )
txt_ent
)
  )


(defun c:c2m (/ ent c_text ins_pt mt_ent)

(if (setq ent (car (entsel "\nSelect Curved Text: ")))
  (if (= (cdr (assoc 0 (entget ent))) "AEC_CURVETEXT")
(setq c_text (cdr (assoc 1 (entget ent))))
)
  ; else
  (progn
(alert "Selected text was not Curved Text")
(exit)
)
  )

(if (setq ins_pt (getpoint "\Text insertion point: "))
  (setq mt_ent (make-txt c_text ins_pt))
  )
(princ)
  )

TheSwamp.org  (serving the CAD community since 2003)

DanB

  • Bull Frog
  • Posts: 367
Arc Text Editor
« Reply #9 on: October 07, 2004, 11:53:29 AM »
Thanks I'll give this a go after lunch and let you know how things work out.

Dan

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Arc Text Editor
« Reply #10 on: October 07, 2004, 12:02:51 PM »
Mark you have a misplaced closing parenthesis... the fact that you have been working in C++ is showing through...
Code: [Select]

(defun make-txt (str pt / txt_ent)
  (if
    (entmake
      (list
'(0 . "MTEXT")
'(100 . "AcDbEntity")
(cons 8 (getvar "clayer"))
'(100 . "AcDbMText")
(cons 10 pt)
(cons 40 (getvar "textsize"))
'(71 . 1)
'(72 . 5)
(cons 1 str)
(cons 7 (getvar "textstyle"))
'(73 . 1)
      )
    )
     txt_ent
  )
)

(defun c:c2m (/ ent c_text ins_pt mt_ent)
  (if (setq ent (car (entsel "\nSelect Curved Text: ")))
    (if (or (= (cdr (assoc 0 (entget ent))) "AEC_CURVETEXT")(= (cdr (assoc 0 (entget ent))) "ARCALIGNEDTEXT"))
      (setq c_text (cdr (assoc 1 (entget ent))))
      (progn
(alert "Selected text was not Curved Text")
(exit)
      )
    )
  )
  (if (setq ins_pt (getpoint "\Text insertion point: "))
    (setq mt_ent (make-txt c_text ins_pt))
  )
  (princ)
)


Oh.. and I also made it compatable with arc aligned text (expresstools ARCTEXT)
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

DanB

  • Bull Frog
  • Posts: 367
Arc Text Editor
« Reply #11 on: October 07, 2004, 12:26:42 PM »
That looks to be working great Mark. One small thing I did happen onto by chance. In the properties window when MTEXT is selected it displays the contents line. After running the lisp and creating the new Mtext, a box "symbol" shows up in the contents line where a "enter"/"return" is. In the mtext editor and on the screen everything looks fine. This may be a font issue or some other bug of sorts, just not sure if this may cause any un forseen problems. Thanks again for your help this morning this will safe us a lot of time.

Dan

Mark

  • Custom Title
  • Seagull
  • Posts: 28753
Arc Text Editor
« Reply #12 on: October 07, 2004, 01:35:35 PM »
what is the contents of the text string that contains the "enter"/"return"? Can you copy-n-paste into a post here?


BTW, thanks Keith. I was trying to get out the door when I posted that code. :D
TheSwamp.org  (serving the CAD community since 2003)

Anonymous

  • Guest
Arc Text Editor
« Reply #13 on: October 07, 2004, 02:16:32 PM »
AL=54.65'
Del=2°01'13"

Above is a direct copy-n-paste of the text string (just an example).

DanB

  • Bull Frog
  • Posts: 367
Arc Text Editor
« Reply #14 on: October 07, 2004, 02:17:35 PM »
oops that was me, wasn't logged in for some reason....