乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 103|回复: 14

[编程交流] Another "First" - Text to Line

[复制链接]

9

主题

61

帖子

47

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
52
发表于 2022-7-6 07:39:55 | 显示全部楼层 |阅读模式
I have a co-worker looking for a way to make certain strings of text into linework. Is this even possible? I thought there might be a LISP routine out there that does something like this.
 
Example: Carthage County Line =  ---- -- ---- -- ---- -- ---- (or something)
回复

使用道具 举报

44

主题

3166

帖子

2803

银币

中流砥柱

Rank: 25

铜币
557
发表于 2022-7-6 07:44:37 | 显示全部楼层
... Not sure I fully understand what you're requesting; perhaps this is what you're after?
 
http://apps.exchange.autodesk.com/ACD/Detail/Index?id=appstore.exchange.autodesk.com%3aText-to-Geometry%3aen
回复

使用道具 举报

9

主题

61

帖子

47

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
52
发表于 2022-7-6 07:50:19 | 显示全部楼层
Thanks RenderMan but I'm not looking for the lines that make up the text to become linework.
 
I'm wanting something to read "County Line" and make a line in the drawing with a phantom linetype. I don't even know if something like this is even possible?
回复

使用道具 举报

44

主题

3166

帖子

2803

银币

中流砥柱

Rank: 25

铜币
557
发表于 2022-7-6 07:56:53 | 显示全部楼层
You want "County Line" to be the command, or something found in the drawing... I am still not understanding.
 
If I am understanding you correctly, you're wanting a routine to detect a *Text entity that includes (or consists of) "County Line" in the Objects TextString, and then you want the code to create a *Line entity within the drawing's ModelSpace? Where?
 
Perhaps a before and after pic would help? More information is needed, methinks.
回复

使用道具 举报

9

主题

61

帖子

47

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
52
发表于 2022-7-6 08:00:15 | 显示全部楼层
 
This is exactly what I'm looking for! Is this possible? Again, this is more of a curiosity than a necessity.
回复

使用道具 举报

29

主题

519

帖子

477

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
163
发表于 2022-7-6 08:03:32 | 显示全部楼层
Is this something like in a drawing legend? Could the start point of the line be a set vertical and horizontal offset from the insertion point of the text and the line a set length? Or does the line need start and end points?
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 08:06:48 | 显示全部楼层
Maybe something like this?
 
  1. ;; Text Linetype  -  Lee Mac;; Creates and loads a custom linetype containing the specified text.;; The linetype will use the Standard TextStyle in the linetype definition.;; The space between dashes in the linetype is calculated based on the number of;; characters in the supplied string, with an additional spacing of 0.05 drawing units.;; Using a monospace font for the linetype will produce the best results.(defun c:txtlt ( / *error* des str tmp val var )   (defun *error* ( msg )       (mapcar 'setvar var val)       (if (= 'file (type des))           (close des)       )       (if (and tmp (findfile tmp))           (vl-file-delete tmp)       )       (if (not (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*"))           (princ (strcat "\nError: " msg))       )       (princ)   )      (cond       (   (= "" (setq str (getstring t "\nSpecify Text for Linetype: "))))       (   (null               (and                   (setq tmp (vl-filename-mktemp nil nil ".lin"))                   (setq des (open tmp "w"))                   (write-line (strcat "*" str "," str " ----" str "----" str "----") des)                   (write-line (strcat "A,.5,-.05,["" str "",STANDARD,S=.1,R=0.0,X=0.0,Y=-.05]," (rtos (- (/ (strlen str) -10.0) 0.05) 2 1)) des)                   (not (setq des (close des)))                   (findfile tmp)               )           )           (princ "\nUnable to create custom linetype definition.")       )       (   (progn               (setq var '(cmdecho expert)                     val  (mapcar 'getvar var)               )               (mapcar 'setvar var '(0 5))               (command "_.-linetype" "_L" "*" tmp "")               (mapcar 'setvar var val)               (vl-file-delete tmp)               (tblsearch "LTYPE" str)           )           (princ (strcat "\n" str " linetype created successfully."))       )       (   (princ (strcat "\nUnable to load linetype " str)))   )   (princ))(princ)
Or have I misunderstood?
回复

使用道具 举报

9

主题

61

帖子

47

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
52
发表于 2022-7-6 08:12:24 | 显示全部楼层
083956iurdphkkub6rdrbb.jpg
 
Does this help?
 
Select "COUNTY LINE" and from that, create a line/polyline at a certain length with a PHANTOM linetype. (Just as an example)
回复

使用道具 举报

9

主题

61

帖子

47

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
52
发表于 2022-7-6 08:16:14 | 显示全部楼层
 
Thanks Lee! That works pretty slick but not exactly what I'm looking for.
回复

使用道具 举报

9

主题

61

帖子

47

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
52
发表于 2022-7-6 08:19:47 | 显示全部楼层
 
It would be really handy for creating a legend Tyke! I hadn't thought of that but it's a great idea.
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-7-4 14:33 , Processed in 1.790956 second(s), 74 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表