progeCAD support, tips and troubleshooting forum. progeCAD works very similar to some versions of AutoCAD. Moderated.

Moderators: caddit, Moderators

#2138 by MelatCMC
Mon Apr 21, 2014 5:40 pm
I remember way back when, when you could create a line of text with a circular justification. The text would be justified to say a arc. We work with autocad 2012 and I was wondering if anyone knew how to do this with this version.

#2141 by caddit
Mon May 05, 2014 2:16 pm
Sorry MelatCMC for the delay a few of us still on holiday leave last week.

You would need to use an autolisp script to accomplish this in progeCAD. There are many to choose from here is one well known version:

Code: Select all;From CADENCE Magazine Febuary, 1989
;Page 56

 (DEFUN CCWTXT ()
    (IF (> STOP STRT)
       (SETQ TANG (- STOP STRT))
       (SETQ TANG (- (* 2 PI) (ABS (- STOP STRT)))))
    (NUMCHAR)
    (SETQ ANG (/ (ABS TANG) (- DL 1))
          CNT 1
          TX (SUBSTR D 1 1)
          SLOPE (/ (+ STRT (/ PI 2)) 0.0174533)
          P (POLAR A STRT R))
    (REPEAT DL
       (COMMAND "text" "m" P H SLOPE TX)
       (SETQ STRT (+ STRT ANG)
             P (POLAR A STRT R)
             CNT (+ CNT 1)
             TX (SUBSTR D CNT 1)
             SLOPE (/ (+ STRT (/ PI 2)) 0.0174533)))
    (PRINC))

 (DEFUN CWTXT ()
    (IF (> STRT STOP)
       (SETQ TANG (- STRT STOP))
       (SETQ TANG (- (* 2 PI) (ABS (- STRT STOP)))))
    (NUMCHAR)
    (SETQ ANG (/ (ABS TANG) (- DL 1))
          CNT 1
          TX (SUBSTR D 1 1)
          SLOPE (/ (- STRT (/ PI 2)) 0.0174533)
          P B)
    (REPEAT DL
       (COMMAND "text" "m" P H SLOPE TX)
       (SETQ STRT (- STRT ANG)
             P (POLAR A STRT R)
             CNT (+ CNT 1)
             TX (SUBSTR D CNT 1)
             SLOPE (/ (- STRT (/ PI 2)) 0.0174533)))
    (PRINC))

 (DEFUN NUMCHAR ()
    (SETQ CARC (* (* 2 PI R) (/ (ABS TANG) (* PI 2)))
          QTY (FIX (/ CARC (* H 0.92))))
    (IF (< QTY 1)(SETQ QTY 1))
    (PROMPT "\n Arc will accomodate approx  ")
    (PROMPT (ITOA QTY))
    (PROMPT " characters ")
    (PROMPT (RTOS H 2 3))
    (PROMPT " high, w/normal spacing.")
    (SETQ D (GETSTRING T "\n Enter text...  ")
          DL (STRLEN D))
    (IF (= DL 1)(SETQ DL 2)))

 (DEFUN C:CIRTXT ()
    (SETVAR "cmdecho" 0)
    (PROMPT "\n>>>> Function To Place Text On A Circle <<<<")
    (SETQ A (GETPOINT "\n       Pick Center of Circular Text  ")
          B (GETPOINT "\n       Pick Middle of First Text Character  ")
          C (GETPOINT "\n       Pick Middle of Last Text Character  ")
          H (GETDIST "\n       Enter text height..... ")
          R (DISTANCE A B)
          STRT (ANGLE A B)
          STOP (ANGLE A C))
    (PROMPT "\n Characters may be written in either direction on the circle.  ")
    (INITGET 1 "CW CCW")
    (SETQ Z (GETKWORD "\nType <CW> for Clockwise or <CCW> for CntrClockwise: "))
    (COND
       ((= Z "CW")(CWTXT))
       ((= Z "CCW")(CCWTXT)))
(princ))



Save the AutoLISP program as a text file like "cirtext.lsp" and load using the APPLOAD command in progeCAD. This will define a new command CIRTXT for what you need.

#2143 by MelatCMC
Tue May 06, 2014 6:29 pm
Copy and pasted the code below to notepad. Saved it as a .lsp file. Appload the file. Say it was loaded successfully, but it is coming in ghosted. When I type it in at the command prompt, it tells me it is an unknown command. What haven't I done or done correctly?

#2155 by caddit
Wed May 21, 2014 3:38 pm
Sorry for the delayed response we are working with some new projects at the moment.


It is hard to know why the script does not work for you. We tested it in our lab environment for progeCAD 2014 and it works as expected:

Image


Are you remembering to select the lsp file from the appload list and click the "load" button after adding it? It WILL return the name of the callable command to the prompt like so:
Code: Select allC:CIRTXT


Afterward just run it by typing "CIRTXT" and follow the in-command instructions.
#2163 by MelatCMC
Thu Jun 12, 2014 1:52 pm
Thank you, did as instructed and it works like a charm.
The time I needed it is passed but I am sure that it will come in handy at a later time.

Mel