alternative for Document.BrowserPanes

alternative for Document.BrowserPanes

JelteDeJong
Mentor Mentor
537 Views
4 Replies
Message 1 of 5

alternative for Document.BrowserPanes

JelteDeJong
Mentor
Mentor

Hi,

I maintain a model generator. (This is an addin in Inventor) One of the steps in the generator process is to delete browser folders (and the Occurrences in the folder) from the assembly. That works fine for the last years. That looks something like this:

JelteDeJong_0-1716901707427.png

But I want the generator to run as a custom job on the job server. Therefore I need to use the InventorServer object that I get from the job server. (Because of that I did run in to some problems but I could work around them.) Except for BrowserPanes object (which I need to get the BrowserFolder object). I have this code:

 

Private Function GetTopNode(oAsmDoc As AssemblyDocument) As BrowserNode
    Dim t = oAsmDoc.BrowserPanes
    Dim oPane = oAsmDoc.BrowserPanes("Model")
    Return oPane.TopNode
End Function

 

line 2 is only there for testing purposes but is also the line where Inventor throws an exception! (The actual line that is not for testing but also throws an exception is on line 3)

 

I found this post by @Markus.Koechl. He writes that the BrowserPanes object is an UI object and therefore should not be used by the InventorServer. I understand this comment but I don't know of any other way to target the occurrences in the folder. I'm hooping that there is an other object that holds the occurrences in a folder. (Maybe a hidden iProperty??)

 

Of course, I could add attributes those occurrences and find them that way. But the point is that we already have a lot of assemblies with folder that work that way. Updating all of those will not be "pleasant"... Furthermore, these assemblies are made/maintained by people that do not have the tools to add those attributes. So that would not be a sufficient solution

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

0 Likes
Accepted solutions (1)
538 Views
4 Replies
Replies (4)
Message 2 of 5

Markus.Koechl
Autodesk
Autodesk

Hi @JelteDeJong : I suggest asking the question for alternate options in the Inventor forum. This is the technical view. Please get in touch with me or your Autodesk account representative directly, as we should also check that your intent complies with our license policies.



Markus Koechl

Solutions Engineer PDM, Autodesk Central Europe
0 Likes
Message 3 of 5

abdullah_elq
Advocate
Advocate

@JelteDeJong could you make a post explaining the basics of automation through the vault job server? Your blog posts are always super useful.

0 Likes
Message 4 of 5

YuhanZhang
Autodesk
Autodesk
Accepted solution

@JelteDeJong As you already know from @Markus.Koechl 's post, that InventorServer currently does not support BrowserPanes. We did receive some scenaros that customers want to use BrowserPanes in InventorServer but we still have not got this planed in our implementation for InventorServer yet. 

 

For you case, I think you can either run your task bases on Inventor, or you can try:

1. In Inventor, create a simple code to just query call the BrowserNode objects in the document and store the browser nodes structure in document Attribute or Property or even a text file with the same name of the assembly.

2.  Create your code for JobServer, when deal with the assembly the code will query the document Attribute/Property or from the text file with the same name as the assembly to get the components' names which will be removed.

3. Remove the components and save document.

 

The problem is that you can't delete the BrowserFolder objects which can only be accessed by BrowserPane. Not sure if above workaround can work for you.



If this solves the problem please click ACCEPT SOLUTION so other people can find it easily.



Rocky Zhang
Inventor API PD
Manufacturing Solutions
Autodesk, Inc.

Message 5 of 5

JelteDeJong
Mentor
Mentor

I can think of multiple ways to work around this problem by doing extra preperations. The point of my question was that I did not want to do any extra preparation. The key users have already prepared everything by placing the occurrence in folders. Therefore I was hoping that the folder information was not only saved in a userinterface object only. I now understand that this is not the case. It's good to know this limitation. That just means that working around this limitation is my only option.

For now, I decided to abandon the InventorServer approach. Starting a full inventor instance makes more sense right now.

 

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

0 Likes