Inventor Engineer-To-Order (Read-Only)
Welcome to Autodesk’s Inventor ETO Forums. Share your knowledge, ask questions, and explore popular Inventor ETO topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Update UIPropertyGrid when importing IKM

8 REPLIES 8
SOLVED
Reply
Message 1 of 9
rikard.nilsson
938 Views, 8 Replies

Update UIPropertyGrid when importing IKM

Hi,

 

I have a question about using UITools in combination with export/import ikm-file.

 

My problem is that I have created a design with some nice values inside my UIPropertyGrid and when everything looks as it should I export an IKM..

When it's time to change my design I start a new empty design and import my IKM..

 

The problem is.. When I do it like this the UIPropertyGrid has all my deafult values or the values from the design before in every UIProperty and I really would like to have all the values from my IKM in the Grid..

 

If I don't have my Dockable Window-addin with the UIPropertyGrid loaded and loads it after I imported the IKM, then it fills my UIPropertyGrid as it should.

It only works the first time after I restarted Inventor and loads the addin after import.

If I in any way show the Grid before I import, then it won't work.

 

 

The only way I can come up with, is if I add a dummy-UIProperty in the top of the Grid that I change so every UIProperty gets updated. But I don't think this a "nice" workaround.

 

And I really would like to have the Grid to have the default values everytime I start e new design..

 

Is there any way to automatic update the Grid to have the values from my IKM or start a new design?? Or in worst case have a button on the Dockable Windows to reset the Grid when it's pushed.

 

Regards

Rikard

8 REPLIES 8
Message 2 of 9

Rikard:

I am sorry, but I don't really understand what you are doing here.  I guess I need a clear set of steps, and maybe an example.  Are you doing this in the Inventor UI, the ETO Studio, or programmatically?

Message 3 of 9

Hi Jack,

 

Here is what I think explains a little better..

 

Background:

I have a simple Dockable Window that just includes a UIPropertyGrid with som UiProperties.

 

Problem 1:

If I start a design and change some values and then open a new one, all the values that I have changed in the first design is still in the UIPropertyGrid. I have to change a value to update the Grid to show default values again. I would like to find a way to reset the hte UIPropertyGrid when I start a new design.

 

Problem 2:

If I have created a design and exported to an IKM-file and then start a new deign and import the IKM. Then the values inside the Grid is not updated. They show the last set of values or the dafult values if I import to a newly started design.. I would like to make sure that if a user imports a IKM then should all the values in the Grid show the values from the imported IKM-file.

 

/Rikard

 

Message 4 of 9

Some more info.

 

Dockable Window = Inventor API (I think)

UIPropertyGrid and UIProperty = ETO UI

Import and Export IKM = Same button that are in the ETO addin-template in Visual Studio..

Message 5 of 9

Rikard,

 

I haven't tested this yet but the UIProject component which controls the UI tools panes has a method called ImportProject() which takes either a path to an IKM file or a byte array for the IKM contents. If you use this UI tools API instead of the one in the VS template (which uses the IntentServices API) it may solve your problem by keeping the other panes in sync. If that doesn't work, you could also try using the ResetProject() method on the UIProject component.

 

I hope that helps,

Scott



Scott Anderson
Principal Software Engineer
Message 6 of 9

Hi Scott,

 

Thanks for your quick answer!

ImportProject() did the trick with IKM

 

And for reseting the UIPropertyGrid I had to use..

intentUIProject1.Reload();
intentUIProject1.Reset();

.. to get the Grid to be set to default..

 

/Rikard

Message 7 of 9

Hello Scott,

 

I was a litle quick when it comes to write that Reload() and Reset() solved the problem of getting the Grid to set all the UIProperties to default.

It gave me a strange result when I opened a new design and tried to change some values..

 

If I try to call ResetProject() the it gives me the error "is inaccessible due to protection level"..

 

What I'm trying to accive is that everytime I open a new design I want all the UI properties to be set to default or if  I open a saved design I want it to show the values when the design was saved.

 

Do you have any other idea?  or if ResetProject() is the solution.. How do I use that method?

 

/Rikard

Message 8 of 9

Hi Rikard,

 

Please attach a dataset that will allow us to research this behavior. Or log a case including the dataset.

 

Thanks,

Wayne



Wayne Brill
Developer Technical Services
Autodesk Developer Network

Message 9 of 9

Hi Wayne,

 

There is no special dataset.. It is the same for all dataset..

Create some UIProperties and then test..

 

I have attached your own Dockable Window with minor changes..

 

The steps to get the problem.

 

1. Start new design

2. Make some changes to your UIProperties

3. Close your design (The values are still the one that you changed to)

4. Starta new deign

5. In the DW you will see that all the values are still there.

 

I want the values to be default values if the design is new and if I open a previous saved design I want the DW to show the values that corresponds to the parameters in that design..

 

/Rikard

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

Post to forums  

Autodesk Design & Make Report