API - How to Apply Method to Active Document
API - How to Apply Method to Active Document
(OP)
I'm in the very beginning stages of learning the SWX API and I have a simple question.
In the following statement (cut from API Help), how do I have the method apply to whatever document is active rather than having to specifically name the file?
There is a preceding statement but I don't understand how to use that object to meet my need.
Thanks in advance.
In the following statement (cut from API Help), how do I have the method apply to whatever document is active rather than having to specifically name the file?
CODE
swApp.GetConfigurationCount("C:\calls5\part3.sldprt")
There is a preceding statement
CODE
Set Model = swApp.ActiveDoc
Thanks in advance.
--------------------
Bring back the HP-15
www.hp15c.org
--------------------






RE: API - How to Apply Method to Active Document
swApp.GetConfigurationCount(swApp.ActiveDoc.GetPath())
im not sure if the call is getpath(), or filename()...or something....but you get the picture
RE: API - How to Apply Method to Active Document
try this:
swApp.GetConfigurationCounts(swApp.ActiveDoc.GetPathName())
RE: API - How to Apply Method to Active Document
retval = ModelDoc2.GetConfigurationCount( ) only works for loaded or open SW files.
count = SldWorks.GetConfigurationCount ( filePathName ) works on files that are not opened.
If your file is already loaded or open, I think you should go with ModelDoc2.GetConfigurationCount.
http://www.EsoxRepublic.com