怎样获得标注的文字内容?
www.dimcax.com
怎样获得标注的文字内容?
要将一个标注的内容单独提出来,从而成为新建文字的内容,在帮助里面找了半天没有发现相关的函数。
(vla-get-measurement (vlax-ename->vla-object (car (entsel))))
好像不行,直接获取属性是"",所以我是先用炸开成text后才能获取的
勤能补拙
(setq ent (entget(car(entsel)))),然后出现列表,列表中的1为修改后的文字内容,42为测量标注的实际数字,如果没有修改过标注那么就应该是42,如果修改过,就保存在1的字符串中,1楼的结果就是42,
好像只能先把标注炸开 然后提取文字内容 这种方法可能笨点 但可以试试
:
(setq ent (entget(car(entsel)))),然后出现列表,列表中的1为修改后的文字内容,42为测量标注的实际数字,如果没有修改过标注那么就应该是42,如果修改过,就保存在1的字符串中,1楼的结果就是42,
lisp的函数看不懂。有vba的就好了。
如果标注是没有修改过的原始标注,那么用以下方法获得标注尺寸
object.measurement
object
dim3pointangular, dimaligned, dimangular, dimarclength, dimdiametric, dimordinate, dimradial, dimradiallarge, dimrotated
the object or objects this property applies to.
measurement
double; read-only
for linear dimensions this is a length, for angular dimensions it is an angle.
如果标注是被修改过的,也就是不是默认值,用以下方法获得
object.textoverride
object
dim3pointangular, dimaligned, dimangular, dimarclength, dimdiametric, dimordinate, dimradial, dimradiallarge, dimrotated
the object or objects this property applies to.
textoverride
string; read-write
the maximum length is 256 characters.
具体查阅cad帮助文件
object.textoverride
果然可行,我一直认为它自由修改尺寸的功能。没有往读取尺寸上想。
:
object.textoverride
果然可行,我一直认为它自由修改尺寸的功能。没有往读取尺寸上想。
呵呵,要分清楚“属性”和“方法”