ketxu 发表于 2022-7-6 08:59:01

[Help] Get variables from othe

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 :

(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

BlackBox 发表于 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.

ketxu 发表于 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 ??

BlackBox 发表于 2022-7-6 09:38:39

Perhaps this will clarify:
 
 

</blockquote> 
linky

ketxu 发表于 2022-7-6 09:47:52

Thank you again for information ^^ So i will try open then close it ^^

BlackBox 发表于 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.
页: [1]
查看完整版本: [Help] Get variables from othe