VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

system variables via Objectdbx

5 REPLIES 5
Reply
Message 1 of 6
Anonymous
339 Views, 5 Replies

system variables via Objectdbx

Hi I just wanted to confirm if it is not possible to set or get sysvars - even ones stored in dwg file - via object dbx.(for example "ProjectName") I was surprised not to find anything on this through google, probably just didnt' find the right search terms, but "dbx" "system" "variable" didnt' yield much. But through experimentation, i get an error if i try to access a dbx document method .GetSystemVariable or SetSystemVariable My hypothesis is that it seems only the active doc can use those methods and since the dbx cant be active, it cant access it's own variables - even though they are stored in the document itself. I was able to set and get with no problems if i open the doc in the editor, but cant seem to with dbx. Am I missing something simple? or is this really the case? Somehow it seems strange if the variable is stored in the dwg that there would be no property or method available to access it even through dbx but if there is I haven't found it yet. Thanks for any info. I couldn't find anything on this in the help either, but again maybe I'm not searching on the right terms to get a hit - the obvious ones don't seem to be turning up any entries Mark
5 REPLIES 5
Message 2 of 6
Anonymous
in reply to: Anonymous

Mark, that function does not work in dbx. It's not because it only works on the active document it's because the function can also read vars outside the dwg. -- Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica (sorry, phony e-mail, SPAM made me do it) "Mark Propst" wrote in message news:40a6b710_2@newsprd01... > Hi > I just wanted to confirm if it is not possible to set or get sysvars - even > ones stored in dwg file - via object dbx.(for example "ProjectName") > I was surprised not to find anything on this through google, probably just > didnt' find the right search terms, but "dbx" "system" "variable" didnt' > yield much. > But through experimentation, i get an error if i try to access a dbx > document method .GetSystemVariable or SetSystemVariable > My hypothesis is that it seems only the active doc can use those methods and > since the dbx cant be active, it cant access it's own variables - even > though they are stored in the document itself. > I was able to set and get with no problems if i open the doc in the editor, > but cant seem to with dbx. > Am I missing something simple? or is this really the case? > Somehow it seems strange if the variable is stored in the dwg that there > would be no property or method available to access it even through dbx but > if there is I haven't found it yet. > Thanks for any info. > I couldn't find anything on this in the help either, but again maybe I'm not > searching on the right terms to get a hit - the obvious ones don't seem to > be turning up any entries > Mark > >
Message 3 of 6
Anonymous
in reply to: Anonymous

Since GetVariable and SetVariable are methods of AcadDocument, they only work on AcadDocuments (they're just wrappers for the ObjectARX counterpart of the (getvar) and (setvar) LISP functions). So there's no method for getting/setting system variables stored in drawings that are accessed directly via ObjectDBX. The AcadXDatabase class in AcadX provides a means to get system variables from drawings accessed via ObjectDBX. It only retrieves system variables that are stored in the dwg file (since that's all that makes sense). I never got around to a SetVariable method, because I never needed it, and it is a lot of work. -- http://www.caddzone.com AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 http://www.acadxtabs.com "Mark Propst" wrote in message news:40a6b710_2@newsprd01... > Hi > I just wanted to confirm if it is not possible to set or get sysvars - even > ones stored in dwg file - via object dbx.(for example "ProjectName") > I was surprised not to find anything on this through google, probably just > didnt' find the right search terms, but "dbx" "system" "variable" didnt' > yield much. > But through experimentation, i get an error if i try to access a dbx > document method .GetSystemVariable or SetSystemVariable > My hypothesis is that it seems only the active doc can use those methods and > since the dbx cant be active, it cant access it's own variables - even > though they are stored in the document itself. > I was able to set and get with no problems if i open the doc in the editor, > but cant seem to with dbx. > Am I missing something simple? or is this really the case? > Somehow it seems strange if the variable is stored in the dwg that there > would be no property or method available to access it even through dbx but > if there is I haven't found it yet. > Thanks for any info. > I couldn't find anything on this in the help either, but again maybe I'm not > searching on the right terms to get a hit - the obvious ones don't seem to > be turning up any entries > Mark > >
Message 4 of 6
Anonymous
in reply to: Anonymous

Thanks for the confirmation, In this case I just wanted to auto set the ProjectName on several folders and their subfolders. Its easy enough to just open the dwgs in a loop as go the dbx route, just wanted to confirm that I wasn't just 'not' seeing it. I know that's a double negative but it still seems the right way to say it!?! :-) The obvious downside of having to open in the editor to do whatever..is tying up the 'hosting' application - the session of acad from which the call to the routine was made. (assuming vba) But it seems that's the case with dbx as well, If i start a dbx loop, it still seems to capture acad's attention and I can print messages to command line or such but I haven't figured a way to make a loop "run in the background" - such that the user could go back to editing the current drawing while the loop is doing it's thing.... I guess that should be a whole different thread. Thanks again for the info, Tony Mark "Tony Tanzillo" wrote in message news:40a6f72e$1_3@newsprd01... > Since GetVariable and SetVariable are methods of AcadDocument, > they only work on AcadDocuments (they're just wrappers for > the ObjectARX counterpart of the (getvar) and (setvar) LISP > functions). So there's no method for getting/setting system > variables stored in drawings that are accessed directly via > ObjectDBX. >
Message 5 of 6
Anonymous
in reply to: Anonymous

"Jorge Jimenez" wrote in message news:40a6daa6$1_1@newsprd01... > Mark, that function does not work in dbx. Thats how it seemed, thanks for the confirmation.:-) > It's not because it only works on the active document > it's because the function can also read vars outside the dwg. That makes sense, since I have no idea what getvar or setvar are really doing I originally thought dbx could generally read whatever info was in there. I see it's not the case. Thanks Mark
Message 6 of 6
Anonymous
in reply to: Anonymous

Mark, don't know if it helps in your case (vba), but you could try and create a new acad session and do the loop there. Once finished, just close the session. But of course, it could get messy doing that from VBA. -- Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica (sorry, phony e-mail, SPAM made me do it) "Mark Propst" wrote in message news:40a7dfd9_2@newsprd01... > Thanks for the confirmation, > In this case I just wanted to auto set the ProjectName on several folders > and their subfolders. > Its easy enough to just open the dwgs in a loop as go the dbx route, just > wanted to confirm that I wasn't just 'not' seeing it. I know that's a > double negative but it still seems the right way to say it!?! > :-) > The obvious downside of having to open in the editor to do whatever..is > tying up the 'hosting' application - the session of acad from which the call > to the routine was made. (assuming vba) > But it seems that's the case with dbx as well, If i start a dbx loop, it > still seems to capture acad's attention and I can print messages to command > line or such but I haven't figured a way to make a loop "run in the > background" - such that the user could go back to editing the current > drawing while the loop is doing it's thing.... > I guess that should be a whole different thread. > Thanks again for the info, Tony > Mark > > "Tony Tanzillo" wrote in message > news:40a6f72e$1_3@newsprd01... > > Since GetVariable and SetVariable are methods of AcadDocument, > > they only work on AcadDocuments (they're just wrappers for > > the ObjectARX counterpart of the (getvar) and (setvar) LISP > > functions). So there's no method for getting/setting system > > variables stored in drawings that are accessed directly via > > ObjectDBX. > > > >

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

”Boost