Author Topic: Text to Closed lwpolylines  (Read 2008 times)

0 Members and 1 Guest are viewing this topic.

ScottMC

  • Newt
  • Posts: 191
Text to Closed lwpolylines
« 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
« Last Edit: April 18, 2023, 08:50:59 PM by ScottMC »

ronjonp

  • Needs a day job
  • Posts: 7527
Re: Text to Closed lwolylines
« Reply #1 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.

« Last Edit: July 09, 2020, 01:03:59 AM by ronjonp »

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

BIGAL

  • Swamp Rat
  • Posts: 1409
  • 40 + years of using Autocad
Re: Text to Closed lwolylines
« Reply #2 on: July 09, 2020, 11:56:24 PM »
Used it great software

A man who never made a mistake never made anything

ScottMC

  • Newt
  • Posts: 191
Re: Text to Closed lwolylines
« Reply #3 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

ronjonp

  • Needs a day job
  • Posts: 7527
Re: Text to Closed lwolylines
« Reply #4 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
There is also this which works very well: http://lee-mac.com/outlineobjects.html

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

ahsattarian

  • Newt
  • Posts: 112
Re: Text to Closed lwolylines
« Reply #5 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)
)

ScottMC

  • Newt
  • Posts: 191
Re: Text to Closed lwolylines
« Reply #6 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..
« Last Edit: November 18, 2020, 09:47:44 PM by ScottMC »