×
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

Extracting custom properties from solidworks files

Extracting custom properties from solidworks files

Extracting custom properties from solidworks files

(OP)
Hi,

I need to extract the custom properties for 2000-3000 soldiworks files ,preferably in a excel .Please let me know what is the best way to do this. If somebody has some program available for this ,would really appreaciate it.

Thanks,
pag

RE: Extracting custom properties from solidworks files

(OP)
Thanks fcsuoer for the reply . But these options are good for populating the custom properties for the solidworks file. I want to extract a fixed set of properties for these 2000 files. It's like if I select a folder , the program should select all the solidworks files from it ,and populate the description custom property from the files in a excel.Also all this should happen without opening the files. I am very new to customizations , so not able to figure out a way for this . I will appreciate  inputs on this.

Regards,
pag

RE: Extracting custom properties from solidworks files

do you have a pdm system?

Colin Fitzpatrick (aka Macduff)
Mechanical Designer
Solidworks 2010 SP 3.1
Dell 490 XP Pro SP 2
Xeon CPU 3.00 GHz 3.00 GB of RAM
nVida Quadro FX 3450 512 MB
3D Connexion-SpaceExplorer

RE: Extracting custom properties from solidworks files

(OP)
No ...these files are currently outside the pdm....but we do have smarteam...

RE: Extracting custom properties from solidworks files

can you batch dump the files into a folder in smart team, and then extract the properties from there?  

Colin Fitzpatrick (aka Macduff)
Mechanical Designer
Solidworks 2010 SP 3.1
Dell 490 XP Pro SP 2
Xeon CPU 3.00 GHz 3.00 GB of RAM
nVida Quadro FX 3450 512 MB
3D Connexion-SpaceExplorer

RE: Extracting custom properties from solidworks files

Here is a very simple macro that should do what you want.  It'll dump the info to a CSV, then you can open it in Excel and save it as an Excel file.  If there are any commas in your descriptions and/or filenames, it may take some massaging to clean it up.

There is a way to do this without opening the files, but it requires installing somet stuff, and it's a bit trickier.  This macro opens the parts, but won't load them into memory.

Make sure you change the paths to what you need them to be.  Also, this is currently for .SLDPRT files.  If you want drawings or assemblies, you just have to change to .SLDPRT to .SLDDRW or .SLDASM.


Dim Part As SldWorks.ModelDoc2

Sub main()

Set swApp = Application.SldWorks

Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile("C:\File.csv", True)

FileName = Dir("C:\*.SLDPRT")
visibility = swApp.DocumentVisible(False, swDocPART)
a.writeline ("Part Number" & "," & "Description")

Do While FileName <> ""
    Set Part = swApp.OpenDoc("C:\" & FileName, swDocPART)
    Description = Part.GetCustomInfoValue("", "DESCRIPTION")
    a.writeline (FileName & "," & Description)
    swApp.CloseDoc FileName
    FileName = Dir
Loop

visibility = swApp.DocumentVisible(True, swDocPART)

End Sub
 

RE: Extracting custom properties from solidworks files

The macro above does load them into memory.  They just won't get a graphics window.

-handleman, CSWP (The new, easy test)

RE: Extracting custom properties from solidworks files

Whoops, that's what I meant to say...

It is possible to get the custom properties (as long as they're not configuration specific) using a vbsript file you create in notepad, but it requires installing some .dll file that's actually for reading Office documents.  It was a long time ago, and our IT whiz-kid figured it out, but I do know for a fact I didn't need SolidWorks open to do it.

RE: Extracting custom properties from solidworks files

There is also the Document Manager API which is part of SolidWorks.  I think it allows access to the configuration specific properties.  However, one needs to request a license key from SolidWorks to include in any macro.

It is not too much of a hassle to get, but if you are only going to do this once, code like what gopack13 posted should suffice.  It is not the fastest way to do it, but you could run it overnight or over the weekend.

Eric

RE: Extracting custom properties from solidworks files

I dont know if this will help, but here is a previous thread about using the Dsofile.dll on SolidWorks documents.

Windows File Custom Properties list utility

Joe
SW Office 2008 SP5.0
P4 3.0Ghz 3GB
ATI FireGL X1

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

White Paper: Industrial Control Basics: Contactors
A contactor is an electrical device used for switching an electrical circuit on or off. Considered to be a special type of relay, contactors are used in applications with higher current carrying capacity, while relays are used for lower current applications. Download Now
Research Report: State of IoT Adoption in Product Development 2019
This research report, based on a survey of 234 product development professionals, examines the current state of Internet of Things (IoT) adoption by product design teams, its perceived importance, and what features and capabilities teams consider important when making decision about adding IoT functionality to their products. Download Now

Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close