vlax get属性(vlax get
你好,我花了5个小时看这个,请停止我的痛苦。(defun tempList (theObject / item dwgName) ;;;item here is nil,object acaddocuments
(vl-load-com)
(setq theList '())
(vlax-for item theObject
(setq dwgName (vlax-get-property item 'Name)) ;;;main question is in this line.
1.how can i see this item in "(vlax-get-acad-object", everything is here right?),before calling its property.I'm using a watch to see whats happening.
2.can you please tell me what do you think i shouldknow on this issue
(setq theList (append (list dwgName) theList))
)
(setq theList (reverse theList))
(princ)
);defun
(setq acadObject (vlax-get-acad-object))
(setq acadDocuments (vla-get-documents acadObject))
(tempListacadDocuments) 你的例行训练目标是什么? 其中对象是(vla get documents(vlax get acad object))
(vlax-for item theObject
(setq dwgName (vlax-get-property item 'Name))
(setq theList (append (list dwgName) theList)))
现在通过代码的设置,您可以收集“名称”(图形名称)并将其保存在变量列表中。姓名列表。现在如果你想“看到”属性和方法
(vlax-for
item(vla-get-documents (vlax-get-acad-object))
(setq theList (append (list item) theList)))
其中,您可以通过以下方式查看每个元素的属性和方法(包括名称)
(vlax-dump-object (nth 0 theList) T) ;<--- index 0
Qonfire公司
你的例行程序会在列表中列出名字,当你运行例行程序(圣殿骑士阿卡多文档)时,你会得到如下结果
(“Drawing2.dwg”“Drawing3.dwg”);
按照编写代码的方式,列表变量没有本地化。然后,您可以将其用于foreach/repeat/mapcar/vl-some等。。。以每个元素作为参数。
我的问题是在我们列出名单之前。假设我们有2个dwg。开的。一个是is文档上的ActivDocument。
我知道如何获得dwg文件的数量。。。我可以得到actif文档的名称,但在“监视”中,我看不到非actif文档。
好的,让我这么说吧,我看到当这行运行时,它需要一个非活动文档(如果没有错的话)并超过它的速率。
在运行此行之前,我如何在“watch”中查看可用项。
或
注意:可能在“手表”中我看不到这些物品,或者我无法找到它们。
感谢
你可以找到它们,但在“手表”窗口中,它太快了,你看不到它。但是,您可以使用断点,当到达该点时,计算将暂停,您可以按CTRL+F8继续。我打赌你会看到手表窗口的价值在变化。
(vlax-for item (vla-get-documents (vlax-get-acad-object))
(setq dwgNames (cons (vlax-get-property item 'Name) dwgNames))
)
(princ (apply 'strcat dwgnames))
请看我附上的毕加索照片。
问题在1 jpeg中
这个vlax是否在迭代时获取项目并更改活动文档?
等号图片是项目第二次更改名称
请最后推一下:)
除非调用vla激活,否则其值始终为“当前”,该激活将激活指定图形。 (vla项目文档0)1 2。。。。。这就是我认为我的样子。谢谢你们的帮助
没有什么大不了的,我所做的只是增加了更多的困惑
继续。。。。
干杯
页:
[1]
2