明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 3894|回复: 6

[LISP]如何在程序中加载线型?

[复制链接]
发表于 2004-11-13 18:37:00 | 显示全部楼层 |阅读模式
我的程序中需要大量不同的线型.请问各位如何在程序中加载线型? 如:MLIN.LIN *BEG 5-20,Border ____ ____ ____ ____ ____
A,20,-5
*BEG 5-30,Border ____ ____ ____ ____ ____
A,30,-5
*BEG 2-30,Border ____ ____ ____ ____ ____
A,30,-2
*BERG 1.2-30,Border ____ ____ ____ ____ ____
A,30,-1.2
*BEG 4-30,Border ____ ____ ____ ____ ____
A,20,-4
发表于 2004-11-13 22:14:00 | 显示全部楼层
如果上面的还不行,看看下面的,据说可以生成简单的线型 这位McSwain, R.K的办法是生成一个临时的.lin线型文件再加载,比较简单直接。 Re:
I have a routine that makes linetypes on the fly. After looking at my code again, I see that I am not using (entmake) but rather writing a temporary .LIN file, then loading it.

Here is an example .LIN file that my program writes after user enters [10"Gas] (without the brackets) as the string for the linetype.

*10INCHGas_
A,0.0010,-0.3500,["10%%34Gas ",standard,S=0.1000,X=-0.3000,Y=-0.0500],-0.3500

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
回复 支持 1 反对 0

使用道具 举报

发表于 2004-11-13 18:59:00 | 显示全部楼层
(command "-ltype" "L" ....)
 楼主| 发表于 2004-11-13 20:05:00 | 显示全部楼层
在DXF群码中能查找到线型源代码吗? 如:线型源代码 *BEG 5-20,Border ____ ____ ____ ____ ____
A,20,-5 能查找到 20 和 -5 ???
 楼主| 发表于 2004-11-13 20:34:00 | 显示全部楼层
线型能修改或者用entmake能生成?


如:


(entmake (list'(0 . "LTYPE") '(70 . 0) '(3 . "Border ____         ____         ____         ____         ____") '(72 . 65) '(73 . 2) '(40 . 59.0) '(49 . 54.0) '(49 . -5.0)(cons 2         "BERDIG 5-58") ))
发表于 2004-11-13 21:36:00 | 显示全部楼层
hkzwsy发表于2004-11-13 20:34:00线型能修改或者用entmake能生成? 如: (entmake (list'(0 . \"LTYPE\") '(70 . 0) '(3 . \"Border ____ ____ ____ ____ ____\") '(72 . 65) '(73 . 2) '(40...

Re: ENTMAKE a Linetype Q
I remember trying years ago to entmake a linetype with varying success
(doesn't mean it can't be done, just that my ability at the time didn't
spawn reliable means, particularly where weird a$$ fonts are concerned). As
I recall I could I could entmake the linetype but entmod would not refresh
the wouldn't update the font file correctly. As fun as it would be to
revisit this challenge I don't have the time now.

In the end I recall that I resigned myself to just force feeding autocad by
writing the linetype definition (file) on the fly and then feeding it to
autocad. See post made Monday, June 05, 2000 4:42 PM labelled "Making custom
linetypes" for some ideas (forgive lousy variable names therein). Also, Mr
Dotson may have some info on his site (www.dotsoft.com).

And now back to breaking blocks ...

Cheers.

<joel@draftingdimensions.com> wrote in message
news:5CBF0497E2DD75D540B7D6996B3FA5EA@in.WebX.maYIadrTaRb...
ENTM AKE a Linetype Q
I am trying to use lisp to make linetypes with varriable in text, so far I
think there is a problem with my entmake list, but Im not sure what im
missing? Any suggestions?

(defun c:ml ()
(setq st (tblobjname "style" "standard"))
(entmake (list
(cons 0 "LTYPE")
(cons 100 "AcDbSymbolTableRecord")
(cons 100 "AcDbLinetypeTableRecord")
(cons 2 "GAS10")
(cons 70 0)
(cons 3 "GAS 10")
(cons 72 65)
(cons 73 3)
(cons 40 1.49)
(cons 49 1.1)
(cons 74 0)
(cons 49 -0.13)
(cons 74 2)
(cons 75 0)
(cons 340 st)
(cons 46 0.1)
(cons 50 0.0)
(cons 44 -0.1)
(cons 45 -0.05)
(cons 9 "10''G")
(cons 49 -0.26)
(cons 74 0)
))
)
 楼主| 发表于 2004-11-14 15:22:00 | 显示全部楼层
谢谢版主!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-11-18 08:43 , Processed in 0.235804 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表