TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: ScottMC on July 08, 2020, 09:31:08 PM

Title: Text to Closed lwpolylines
Post by: ScottMC on July 08, 2020, 09:31:08 PM
Didn't shop to long but know they would rather us pay for everything. Anyway.. this one makes me realize the value of region in that to do this manually is not so bad but to automate would be better/prefered for sure. In the operation, the converting the txtexp-loaded lwpolylines into a region must be done one-by-one else when converting to a lwpolyline from the region as one object doesn't work or I need a different region-2-poly converter. Still this single conversion sub operation is certainly why I'm here! For me it's just explode the text, convert them to regions, then separately union the regions of each letter, finally convert the regions to lwpolylines. My guess [bad] is to select the converted letter as a separate region would be by selecting touching objects of the converted..... Thanks guys for your help
Title: Re: Text to Closed lwolylines
Post by: ronjonp on July 09, 2020, 12:59:46 AM
Have you seen this: http://www.theswamp.org/index.php?topic=31435.0

The latest version can create regions.

Title: Re: Text to Closed lwolylines
Post by: BIGAL on July 09, 2020, 11:56:24 PM
Used it great software

Title: Re: Text to Closed lwolylines
Post by: ScottMC on July 10, 2020, 12:17:56 PM
Thank You Very Much Sir Gile. Such a relief on time and certainly a tool to learn from!

https://www.theswamp.org/index.php?topic=20642.msg251311#msg251311 (https://www.theswamp.org/index.php?topic=20642.msg251311#msg251311)
Title: Re: Text to Closed lwolylines
Post by: ronjonp on July 10, 2020, 01:37:45 PM
Thank You Very Much Sir Gile. Such a relief on time and certainly a tool to learn from!

https://www.theswamp.org/index.php?topic=20642.msg251311#msg251311 (https://www.theswamp.org/index.php?topic=20642.msg251311#msg251311)
There is also this which works very well: http://lee-mac.com/outlineobjects.html
Title: Re: Text to Closed lwolylines
Post by: ahsattarian on November 17, 2020, 12:08:20 PM
This Lisp is what u need  :





(defun c:wmft ()
  (setq ss (ssget '((0 . "*TEXT"))))
  (command "wmfopts") ;| ckeck for solid !! |;
  (setq file (strcat (getvar "dwgprefix") "wmf.wmf"))
  (setq n (sslength ss))
  (setq k -1)
  (repeat n
    (setq k (1+ k))
    (setq s (ssname ss k))
    (setq en (entget s))
    (setq pt1 (cdr (assoc 10 en)))
    (setq pt2 (polar pt1 (* pi 0.5) 1.0))
    (setq obj (vlax-ename->vla-object s))
    (setq typ (cdr (assoc 0 en)))
    (setq bw 0)
    (cond ((and (= typ "TEXT") (= (vlax-get-property obj "backward") :vlax-true)) (setq bw 1)))
    (cond ((= bw 0) (command "mirror" s "" pt1 pt2 "yes")))
    (command "zoom" "object" s "")
    (command "wmfout" file s "")
    (setq viewctr (getvar "viewctr"))
    (setq viewsize (getvar "viewsize"))
    (setq screensize (getvar "screensize"))
    (setq ratio (/ (car screensize) (cadr screensize)))
    (setq po (polar viewctr (* pi 0.5) (* viewsize 0.5)))
    (setq po (polar po (* pi 1.0) (* viewsize ratio 0.5)))
    (setvar "clayer" (vla-get-layer obj))
    (command "wmfin" file po 2.0 2.0 0.0)
    (entdel s)
  )
  (setvar "clayer" "0")
  (princ)
)
Title: Re: Text to Closed lwolylines
Post by: ScottMC on November 17, 2020, 12:52:16 PM
As with my A2K ET "TXTEXP" the outlines are divided and require work.. Thanks though for reminding me of the WMF/ET tools!! Using: "MERGE -Gilles Chanteau- 01/01/06" manually after a "CONVERTPOLY... as it converts to 2Dpoly..