Cancel
Showing results for 
Search instead for 
Did you mean: 

Deleted Undo Marks During BlockStyler Application

Pioneer
Pioneer

Hello everyone!


I read about this a few times, but I did not think that my application would actually have to deal with this issue until yesterday, when I also got the error message about undomarks which where deleted during some operation in my application.

 

As far as I can see, I am not closing any parts while the application is running. All I am doing is to iterate though all parts in an assembly, declaring each one as the workpart and doing some operations. Does this already count as closing the part? Or can this error also occur while cycling through an assembly?

If so, is there maybe a workaround? I already read about having a "dummy" part open all the time to avoid the clearing of undo marks, but since I just cycle through the parts, there is no point without an open part.

All the operations I perform are done within the ok callback, if this is of any help.

I hope somebody may have an idea, as I am starting to get nervous about this problem Smiley Very Happy

Regards,
Steve

4 REPLIES 4

Re: Deleted Undo Marks During BlockStyler Application

Pioneer
Pioneer
I think I managed to trace the root of the issue, but unfortunately I am not able to resolve it.

In the ok_callback I use a few subs. The two most important might be:

1. A recursive function "compList" that recursively sets the components of the Assembly as a workpart and performs some operations (like getting the bounding box and so on) ans writes it into a DataTable.
One of the columns in the DataTable is "Component" where I save the component itself.

2. The secound function "checkXW" then cycles through all the rows in the DataTable and uses

theSession.Parts.SetWorkComponent(row(componentTable.Columns("Component")), Nothing)
workPart = theSession.Parts.Work

to open up each component and performing several other operations.

For some reason the first function works without any problems. The second one removes the undoMarks and I get an error.

I hope somebody knows what I am doing wrong over here. Thank you very much in advance

Re: Deleted Undo Marks During BlockStyler Application

Legend
Legend

Hi @SteveU 

I am making a wild guess because I cant able to access your code. This may work, Don't change the workpart when your GUI is loaded. Read the info from the UI. let the UI unloads and change your workpart or do whatever you want. This is one of the standard practices Which I follow. 

Let us know whether this helps.

伊尔凡

Re: Deleted Undo Marks During BlockStyler Application

Pioneer
Pioneer

Thank you very much for your reply @Irfan23 ! 

 

I tried several other things in the last week, and I think that your suggestion might be the right thing to do. Unfortunately I am new to the concept of unloading the UI, loading a part and loading the UI again. 

Can you maybe help me on how to perform this operation? Or give me a hint on which commands I have to use to do so? 

I am looking forward to hearing from you and thank you in advance!

Re: Deleted Undo Marks During BlockStyler Application

Legend
Legend

@SteveU 

 

From your previous post, I predict that you are calling some method inside OK or Update Callback, which changes the part. Dont do that. Collect the information UI and Store in a container. Once OK CB executes control goes back to main method. Now get the information from the container and change your Workpart from there. I am making random guess. Give a shot.  

 

 

伊尔凡