乐筑天下

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

[编程交流] [Help] Get variables from othe

[复制链接]

22

主题

326

帖子

185

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
243
发表于 2022-7-6 08:59:01 | 显示全部楼层 |阅读模式
Hi all,
I've a problem and i can't solve it by myself, please help me
I want to get some variable from other Drawing (but not open it in Editor), so i've to use DBX.
I have this :
  1. (defun get_sth ()(defun _ObjectDBXDocument ( acapp / acVer )   (vla-GetInterfaceObject acapp     (if (< (setq acVer (atoi (getvar "ACADVER"))) 16)       "ObjectDBX.AxDbDocument" (strcat "ObjectDBX.AxDbDocument." (itoa acVer))     )   ) ) (setq acapp (vlax-get-acad-object)  )(setq dbdoc (_ObjectDBXDocument acapp)       dwg "D:\\Test.dwg") ; this file exist already(setq doc (cond ((not (vl-catch-all-error-p (vl-catch-all-apply 'vla-open (list dbdoc dwg))))                   dbdoc                 )               )             ); What will i do here to get sth infor of variable, ex Clayer, or Dim variable or sth else ...?;vla-getvariables not work)
 
I've tried to read others rountine about DBX , but ...
Please help me.
Thanks for reading
回复

使用道具 举报

44

主题

3166

帖子

2803

银币

中流砥柱

Rank: 25

铜币
557
发表于 2022-7-6 09:20:53 | 显示全部楼层
I'm pretty sure you cannot accomplish this using traditional methods (getvar, setvar, etc.). You have to use the ActiveX Object Model.
 
For example, look into the ActiveLayer Property of the Layer Collection of DbDoc.
回复

使用道具 举报

22

主题

326

帖子

185

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
243
发表于 2022-7-6 09:29:25 | 显示全部楼层
Thanks you verymuch.. But i wonder what about with other variables store in DWG ? We can't access it ??
回复

使用道具 举报

44

主题

3166

帖子

2803

银币

中流砥柱

Rank: 25

铜币
557
发表于 2022-7-6 09:38:39 | 显示全部楼层
Perhaps this will clarify:
 
 

</blockquote> 
linky
回复

使用道具 举报

22

主题

326

帖子

185

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
243
发表于 2022-7-6 09:47:52 | 显示全部楼层
Thank you again for information ^^ So i will try open then close it ^^
回复

使用道具 举报

44

主题

3166

帖子

2803

银币

中流砥柱

Rank: 25

铜币
557
发表于 2022-7-6 10:08:43 | 显示全部楼层
You're welcome; again, this is to the best of my knowledge.
 
If there exists a way to accomplish this (via ObjectDBX), I too would be very interested to know.
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-7 06:08 , Processed in 0.562615 second(s), 64 queries .

© 2020-2025 乐筑天下

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