XML file location

The Axemble SmartProperties allows you to manage the location of XML according to the type of part (Part, Assembly, etc.)

 

Is it possible to create a macro that reads a property from the SW file (from the PorpertyManager) and redirects to a dedicated SmartProperties (XML) based on the value of this property?

 

This macro would be launched directly with the SmartProperties.


capture.png

To do this, you need a macro that will modify a SmartProperties configuration file, and it seems complicated !

 

It is possible to add lines to a text file with VBA, but not to modify the lines of the file...

So on my photo, I put the same path for all types (to the Smart N°1 which launches the macro)

 

Is it the fact of launching an XML Smart from the macro that is complicated?

How many XML files would there be? Few?

 

Because in this case, you can create as many settings files as you want, and overwrite the existing one by renaming the one you want according to your property with this instruction:

 

My. Computer.FileSystem.RenameFile("C:\Test.txt""SecondTest.txt")

http://msdn.microsoft.com/en-us/library/5w05844e.aspx

No, I'm going to have 5-6 max

 

I'll look at your info. Thank you

1 Like

Do you want to change the display of SmartProperties according to the file type or something else?

 

You say "I put the same path for all types (to the Smart N°1 that launches the macro)"

What do you mean by "I put the same path for all types" => this is not the case on your screenshot!

What do you call the smart N°1?

 

What do you mean by "running an XML Smart"?

My second answer provides more details on a possible solution.

Basically, I fill in (via templates) a "TypeDeTemplate" property on the 3D files.

 

Afterward, by clicking on the SmartProperties, I want it to launch the XML that corresponds to the property.

As a result, it makes a smart dedicated by size (and no longer by type of room as is currently the case...)

 

To launch this "calculation", I was thinking of going through a first common Smart (Smart N°1) which starts by launching the macro. Then it redirects...

Is it clearer?

Yes, so you can try to rename and overwrite the XML file as I suggested.

I don't understand the principle of your solution

I create a macro that will change the path of the photo's XML?

Hello

 

No need for a macro for that.

Make a smartproperties in the part template with a single properties of type "XML link to other xml file" and then create a txt file listing all the other xml.

 

@+

 


smartproperties.jpg
3 Likes

Coyotte, is it possible to change the setting automatically according to a custom property?

@Coyote: Currently, the choice is made by hand via this drop-down list (.txt)

 

"Coyote, is it possible to change the setting automatically based on a custom property?"

I'm asking you the same question, Coyote. If the setting can change according to a property (or a template), that's great. But how do you do it?

 

Thank you

And with the use of the "Conditional" tool, there is no way to directly launch another XML (without the need to validate)?

Hello

 

I don't understand, I think clearly, the question.

 

In my use when I launch my SmartProperties in a parts file I access a single property (the one of my screenshot) with which I have a drop-down list to choose the type of part (purchased, manufactured, sheet, ....) which points to a txt in which my types are associated with an xml path.

So I open my smartproperties, I choose the type of room from my list, and there I come across another smart xml to fill in my properties.

 

The only flaw of this when I restart my smartproperties is that I have to click again in my drop-down list.

 

@+

 

1 Like

Quite simple...

 

This allows you to launch a dedicated SmartProperties based on the value of the "TypePiece" property


macro_choix_xml_via_propriete.txt