SolidWorks Exporter

Announcements, information, requests and support regarding other exporters and general/new exporters
Post Reply
102 posts
jeffr
Posts: 120
Joined: Sun Jan 28, 2007 2:08 pm

SolidWorks Exporter

Post by jeffr » Sat Jul 21, 2007 10:32 am

I have have finally completed a SolidWorks exporter to a point where I can share it for testing.

I have made two versions. One version exports all the geometry data into one Indigo file in Indigo format(Indigo_Geometry_Export). The other version exports the geometry in an OBJ file that is linked to the Indigo file.

It's still not up to the level I want it but I'm hoping some SW users get hold of this and want to help get it there.

I can also use any other help with some of the more Indigo specific things like materials, etc.

Right now I can't make use of any materials that need uv coordinates (albedo or bump mapped) . I can't see where SW can give me any uv's and don't know how to generate them from the geometry data I do get.

Place the macro into a folder you create "C:\Program Files\SW_Indigo_Exporter" and also create a folder within this folder called Materials. Any materials will be put in this folder. A button can be added to the SW toolbar to call the macro.

To use materials the user simply picks a material from the list in Solidworks as they might normally assign a material. There needs to be a corresponding material file in the Materials folder. Example - you can assign Chrome to a part in SW. If you have a material file called Chrome, it will be used by that part and the final rendering will show this part to be Chrome.

Because of some naming issues I found with some materials I suggest creating a new material library in SW with custom named materials that use one word names. ( I ran into problems where SW has materials called 'Cast Carbon Steel' , 'Cast Stainless Steel', etc. It sees both only as Cast. Not sure if this is the case with both versions but is with the OBJ export version.)

I could use help getting material files created for different materials for the library if anyone is interested. I also could use some help from anyone else who knows anything about the SW API programming.


*****Edit***** Now it's strictly one version. The exporter exports the model geometry into an obj file and creates an Indigo scene file that calls it.
At the moment the appearance settings in Solidworks do not do anything other than match the colour.

Change the settings for appearance by right clicking the part name in the left panel of an assembly and selecting appearance .
Attachments
SW_Indigo_Export.zip
Sept 5
(262.83 KiB) Downloaded 810 times
Last edited by jeffr on Thu Sep 06, 2007 2:07 pm, edited 8 times in total.

User avatar
OnoSendai
Developer
Posts: 6241
Joined: Sat May 20, 2006 6:16 pm
Location: Wellington, NZ
Contact:

Post by OnoSendai » Sat Jul 21, 2007 4:51 pm

Great, thanks Jeffr!

jeffr
Posts: 120
Joined: Sun Jan 28, 2007 2:08 pm

Post by jeffr » Sun Jul 22, 2007 2:51 am

I'm motivated by having the use of such a great renderer :wink:

User avatar
xrok1
Posts: 287
Joined: Wed Jun 13, 2007 11:26 am

Post by xrok1 » Fri Jul 27, 2007 7:32 am

this is what i get when i try to use it. i'm using solidworks '06 if that helps.

P.S thank you soooo much this is great! :P
Attachments
error.JPG
error.JPG (16.67 KiB) Viewed 18723 times
Last edited by xrok1 on Fri Jul 27, 2007 7:51 am, edited 1 time in total.

User avatar
xrok1
Posts: 287
Joined: Wed Jun 13, 2007 11:26 am

Post by xrok1 » Fri Jul 27, 2007 7:49 am

this is what i get in the debugger.
Attachments
Capture2.JPG
Capture2.JPG (47.36 KiB) Viewed 18721 times

jeffr
Posts: 120
Joined: Sun Jan 28, 2007 2:08 pm

Post by jeffr » Fri Jul 27, 2007 8:01 am

xrok1

are you rendering a part or an assembly? (**edit - silly me, I can see it's a part from where it stopped. I'll dig into it and see if I can fix it )

I've really neglected to test with a part file it's always been assemblies. I also have a problem with sub-assemblies within an assembly right now.

I have some updates that I'll get up soon. I've solved my UV problem (I think) so textures and bump maps can be used, I've been able to get the colour, difuse, specularity etc. from solidworks now so materials can be created and used on the fly right out of solidworks.

Oh yes I just remembered. I forgot to include the light meshes in the download. If you convert sw lights it won't work for you at the moment. (until I fix the download)

It's still in the early stages so forgive me for the bugs but I think it's going to be pretty good once it gets the kinks worked out.

Anythink that you think would improve the interface or anything else let me know. I appreciate your feedback.

Cheers
Jeff

User avatar
xrok1
Posts: 287
Joined: Wed Jun 13, 2007 11:26 am

Post by xrok1 » Fri Jul 27, 2007 8:34 am

here my attempt at an assembly.

can't comment on the interface i havn't seen it yet :lol: expect lots of suggestions/comments from me, and i'll help if i can.

i can't tell you how excited and appreciative i am that you're doing this.
Attachments
error2.JPG
error2.JPG (17.33 KiB) Viewed 18709 times
Capture2.JPG
Capture2.JPG (30.35 KiB) Viewed 18710 times

User avatar
xrok1
Posts: 287
Joined: Wed Jun 13, 2007 11:26 am

Post by xrok1 » Fri Jul 27, 2007 8:43 am

maybe this thread could get moved to the forum index since i think its officially an exporter now. i'm sure it would get a lot more feedback if it were more visible. did i mention how great this is.

P.S even if the macro only worked with assemblies one could still insert their single part into an assembly so don't sweat it.

User avatar
xrok1
Posts: 287
Joined: Wed Jun 13, 2007 11:26 am

Post by xrok1 » Fri Jul 27, 2007 8:51 am

there is one more thing i think solidworks has always lacked and since you're code is already going looking the materials, maybe you could add a little form for select by material. this is a real pain in SW cause you have to select every single face manually (if you don't want to paint the whole feature, body...) and if you want to change it later you have to do it all again. it would be like grouping by material which should be standard anyway but isn't for some strange reason.

P.S i wish i could code the SW api like you can, i'd add a lot of common sense functionality the program lacks. but alas i've only writen a couple of macro's, nothing too complicated. it seems their API info is hard to come by and even harder to discifer. if you have some good info on it i'd appreciate a copy and would love to help you where i could.
Last edited by xrok1 on Fri Jul 27, 2007 9:02 am, edited 1 time in total.

jeffr
Posts: 120
Joined: Sun Jan 28, 2007 2:08 pm

Post by jeffr » Fri Jul 27, 2007 8:57 am

hmmm

that last problem is a mystery.
I tried something on the assumption you were running the macro by going Tools->Macro->Run and then loading the macro and I got the same problem.
What's strange is that I've made a custom button to run the macro and it works fine that way.

Try this and see if you get it to work. (In case you don't already know this)
Right click on the toolbar. Select 'Customize. Go to the Commands tab and select Macro. Click on the icon for 'New Macro Button' and drag it to the toolbar. In the popup window under action where it say Macro browse to the macro so it goes in here. Click ok.

Try running it now from this and let me know if it brings up the interface.

User avatar
xrok1
Posts: 287
Joined: Wed Jun 13, 2007 11:26 am

Post by xrok1 » Fri Jul 27, 2007 9:08 am

yes that works to bring up the interface but now i get runtime error '91' when i hit the export button.

P.S not to get side tracked but did you see my P.S i added to my last post?
Attachments
error3.JPG
error3.JPG (19.09 KiB) Viewed 18695 times

User avatar
xrok1
Posts: 287
Joined: Wed Jun 13, 2007 11:26 am

Post by xrok1 » Fri Jul 27, 2007 9:28 am

i got rid of the runtime error '91' by adding a camera.

then i got a path error so i renamed my indigo directory to just indigo, it was named (\indigo_08_stable) even though i had the indigo.exe path named correctly in your form it didn't work till i did this change.

now i get this with .obj or .igi export. and when i go to the SW_Indigo_Exporter dir. the only file in there is an .ini file which contains the indigo.exe path.
Attachments
error4.JPG
error4.JPG (106.99 KiB) Viewed 18684 times

jeffr
Posts: 120
Joined: Sun Jan 28, 2007 2:08 pm

Post by jeffr » Fri Jul 27, 2007 9:37 am

I just uploaded exactly what I have at the moment. That way we can be at the same place.

Sorry I don't really have any documentation to direct you to for macro's. I've just doing allot of experimenting with the examples etc. in the API help file. If you go to http://www.solidworks.com/pages/service ... pport.html there are more resources there. Feel free to pick my brain all you want. I don't think of myself as much of a master either but I'll help if I can.

jeffr
Posts: 120
Joined: Sun Jan 28, 2007 2:08 pm

Post by jeffr » Fri Jul 27, 2007 9:38 am

The light thing will be fixed with the updated files.
This one is a 'dummy me' moment for not including it in the first place.

User avatar
xrok1
Posts: 287
Joined: Wed Jun 13, 2007 11:26 am

Post by xrok1 » Fri Jul 27, 2007 9:57 am

ok my bad. i didn't copy the macros to \SW_Indigo_Exporter. now i can get the geometry_export to work but not the indigo_export to work.

BUT...here is the result.
Attachments
Capture3.JPG
Capture3.JPG (306.75 KiB) Viewed 18675 times

Post Reply
102 posts

Who is online

Users browsing this forum: No registered users and 20 guests