×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Map old Materials Database to a new one

Map old Materials Database to a new one

Map old Materials Database to a new one

(OP)
We have used the default SolidWorks Materials Database and several of our own databases for over a year. Up until now, no control existed over the creation or modification of our data;  users created materials and databases as they had the need.

Now we want/need to implement a new Materials Database to clean up this mess.  When it's done, we want to erase the old stuff.

We have finished the new database (as we believe we want it as the finished product).  As much as possible, existing material names and properties have been copied from the old files into the new (except for junk).

We then replaced the old sldmat files with the new one.  Now when a part is opened and the material is edited, a warning says the material could not be found  and a "Temporary Database" is started.

OK, this behavior is expected:  I’ve eliminated a data source and I haven’t done anything to tell the part to look elsewhere for data.  What I'm looking for is a method or a macro or a suggestion on how to map the material name from one database to another.   I’m thinking that a macro could do this, but I have zero experience with writing macros.  

Would it be possible to open a part and execute a macro that queries the existing material name and maps it to the new sldmat file?  And as long as I’m asking, could this be done as a bulk process (Task Scheduler maybe??) ?


Thanks for yer support! and please, minimize the scolding  sad

DC

SolidWorks 2007 SP 2.1
Windows XP

RE: Map old Materials Database to a new one

Quote:

We then replaced the old sldmat files with the new one
To clarify ... You replaced the original solidworks materials.sldmat in the SolidWorks install folder?

cheers
SW07-SP3

RE: Map old Materials Database to a new one

(OP)
Good point.

No, I have not touched the original solidworks materials.sldmat file.

We have a network location that everyone maps to in their System Options / File Locations / Material Databases.

DC

RE: Map old Materials Database to a new one

Is the Tools > Options > System Options > File Locations pointing to the correct location?

cheers
SW07-SP3

RE: Map old Materials Database to a new one

(OP)
YES

We have a network location that everyone maps to in their System Options / File Locations / Material Databases.

DC

RE: Map old Materials Database to a new one

I believe the material database is in XML.  If you are careful it may be possible to literally cut and paste the entries from one database to another.  Open the files in notepad.  Study the file.  Find the entries in the database you want to copy.  Copy those entries and paste them into your desired new database. I have never tried this, but don't see why it wouldn't work...

Pete

RE: Map old Materials Database to a new one

Yes it is xml.

If you go that route make a backup of the original file ... just in case.

cheers
SW07-SP3

RE: Map old Materials Database to a new one

(OP)
In my original post, I stated that the sldmat files were edited, data was copied where appropriate, junk eliminated, etc ....

The editing of the sldmat files is not the problem.

The problem is the name of the files.

Let me use an example:
I have assigned material to a part from a file "My Materials.sldmat" containing AISI 304.
There is a new material file "Company Materials.sldmat" containing AISI 304.
I want to eliminate "My Materials.sldmat".

When "My Materials.sldmat" is removed, then I open my part and edit the material, AISI 304 is not recognized and a Temporary Database is opened.

I must fix the problem by manually picking "Company Materials" and then AISI 304.

So, I have a method that works, but I want to know is if there is a means to automate or simplify or mass execute this process using a macro or some other means.

Thanx.
DC

RE: Map old Materials Database to a new one

For you to do this in a macro, there will need to be already existing objects that know how to handle a .sldmat file.  Since SW is VB.NET based, there should be something, but it may not be available to call from the API.  If know one here knows, I would check with your VAR.

Matt
CAD Engineer/ECN Analyst
Silicon Valley, CA
http://sw.fcsuper.com/index.php

RE: Map old Materials Database to a new one

I think for each part that uses the old database, you will need to remove the mtl, save the part, then add new mtl. There may be a macro already to do this.
We will have to search around.

Chris
SolidWorks 07 3.0/PDMWorks 07
AutoCAD 06
ctopher's home (updated 03-26-07)

RE: Map old Materials Database to a new one

Check this topic:

Set Material Property Name Example (VB)

in SolidWorks and Add-Inns API help.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources