Reply

Drop Property Text

I need to be able to drop all property text on a drawing - I have used Application.StartCommand(CommandID:=10182), which I got using Spy for SE, but this command requires a confirmation by the user.

How do I do run the command without a user confirmation?

Alternatively how do I run the command but force it to wait for user confirmation, as at the moment the programme continues, closes the file but leaves the confirmation window open.

Closing the confirmation window crashes Solid Edge.

HP Z420 16GB RAM
Quadro K4000
ST7 MP10 on Windows 7 Pro 64.
6 REPLIES

Re: Drop Property Text

You're almost always better off coding it yourself than relying on StartCommand(). The command in question is Home -> Property Text -> Convert All. I will work on creating a sample that will emulate the process and that you can learn\copy from.

Jason Newell
Applications Architect
www.jasonnewell.net

Re: Drop Property Text

Thank you very much Jason.

The macro was originally written in vb.net 2008, although I am updating macro's to 2013 as and when I need to modify them.

This macro is one we use for creating Excel BOM's from the drawing parts lists and also for converting to pdf, dxf,dwg & dgn.

 

My computer has Excel 2013 installed and I find that if I build the macro on this one it will not run on computers that have earlier versions of Excel. I got round it by doing the build on my home computer.

Do you have any suggestions on how to ensure it will run with any version of Excel?

HP Z420 16GB RAM
Quadro K4000
ST7 MP10 on Windows 7 Pro 64.

Re: Drop Property Text

Sorry for the delay. I have added a new ConvertPropertyText sample on Github for you.

 

To answer your question about dealing with different version of Excel, I'm afraid there's not much you can do. It's one of the reasons I loath Office VBA.

 

Let me know if you have any questions.

Jason Newell
Applications Architect
www.jasonnewell.net

Re: Drop Property Text

Thank you Jason, I'll have a look at that.

Pity about the excel versions.

HP Z420 16GB RAM
Quadro K4000
ST7 MP10 on Windows 7 Pro 64.

Re: Drop Property Text

Just an update Jason,

I was concerned with dropping all the property text prior to doing the Save As operation, because if anything went wrong I could be left with the original file changed. It shouldn't happen but the possibility was enough to put me off.

 

A slightly different approach was to do the Save As first, then simply change the property text to have the correct value in the new file. (I check to make sure the filename has changed before continuing)

By referencing the code given in your link I was able to loop through all balloons on the working and background sheets, and if the balloon text contained %{Filename (no extension)} I could replace it with the correct text.

 

Thanks again Jason.

HP Z420 16GB RAM
Quadro K4000
ST7 MP10 on Windows 7 Pro 64.

Re: Drop Property Text

Good deal. Thanks for the udpate.

Jason Newell
Applications Architect
www.jasonnewell.net