SolidWorks Exporter

Announcements, information, requests and support regarding other exporters and general/new exporters
Big Fan
Posts: 745
Joined: Tue Oct 17, 2006 9:37 am
Location: Nelson NZ

Post by Big Fan » Sat Jul 28, 2007 4:50 pm

does this need SW06 and above? nothing opens in 05...

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

Post by xrok1 » Sat Jul 28, 2007 6:17 pm

check all jeffr's posts and follow the first one and the one about making macro buttons exactly, i had problems at first too till i went back and read them more carefully.

P.S i don't know if its fixed yet, but to be safe use only with assemblies and make sure you add a camera in SW.
Last edited by xrok1 on Sat Jul 28, 2007 6:36 pm, edited 1 time in total.

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

Post by xrok1 » Sat Jul 28, 2007 6:23 pm

jeffr,

THat's what i'm talkin about buddy. way to go. works like a charm.

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

Post by xrok1 » Sat Jul 28, 2007 7:17 pm

sorry i may have spoke too soon. there's still a scaling problem. image 1 is scaled @1, image 2 is scaled @100 notice how it gets blocky? if i scale any higher the blockyness gets so bad that you can't even recognize your object. is there any way to aytomatically scale the output based on the camera settings? maybe the field of view divide the Distance to view rectangle by the Height of view rectangle? just an idea but it seemed to work pretty well in my tests.
Attachments
scale100.JPG
scale100.JPG (197.11 KiB) Viewed 8745 times
scale1.JPG
scale1.JPG (212.37 KiB) Viewed 8745 times
fov.JPG
fov.JPG (19.23 KiB) Viewed 8745 times

Big Fan
Posts: 745
Joined: Tue Oct 17, 2006 9:37 am
Location: Nelson NZ

Post by Big Fan » Sat Jul 28, 2007 9:06 pm

ok thanks unfortunately SW05 doesnt have a camera (was added in 06) so the macro isnt much good to me unless it could read the window view as an alternative.
I have a feeling for SW08 things might have changed again with Realview enhancements and also with the linking to Photoworks...perhaps the textures will be more accessible

User avatar
suvakas
3rd Place Winner
Posts: 2613
Joined: Mon Sep 04, 2006 11:08 pm
Location: Estonia
Contact:

Post by suvakas » Sat Jul 28, 2007 9:48 pm

Too large models render blocky in Indigo.
I think it's a known issue. (there was a thread about it some time ago)

Indigo uses meters for everything. Why would you ever want to have a scale as high as 100? It means, that 1 unit in your app = 100 meters in Indigo. Way too large to my understanding. At least that's how it works in other apps I think. How come the scale is related to camera in SW?

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

Post by jeffr » Sun Jul 29, 2007 2:16 am

Big Fan
It could still be usefull for you as it is as an obj exporter so you models can be imported more easily into other programs. It will need a tweak to allow that.
I will work on that. I will also see if I can figure out how to go without a camera and just use the view.
2006 has realview and the api connections to photoworks and none of the sw api info anywhere I've looked is giving any indication there may be an issue so I hope...

Scaling may or may not be usefull depending on what is being worked on and what units it's in I suppose. Solidworks also exports in meters regardless so a 1 inch block exports 0.0254 as the highest number. Is there such a thing as too small in Indigo? Some of this stuff I'm still trying to figure out.

Here's my latest test image.
Attachments
im1185619798.png
im1185619798.png (701.2 KiB) Viewed 8729 times

User avatar
suvakas
3rd Place Winner
Posts: 2613
Joined: Mon Sep 04, 2006 11:08 pm
Location: Estonia
Contact:

Post by suvakas » Sun Jul 29, 2007 4:09 am

jeffr wrote: Scaling may or may not be usefull depending on what is being worked on and what units it's in I suppose.
Yes, scaling is useful (don't get me wrong). But taking 100 meters as one unit seems too much.
Nice progress by the way. Good luck with the exporter!

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

Post by xrok1 » Sun Jul 29, 2007 6:29 am

jeffr, can you explain to me how you're getting the textures? are you just copying the solidworks textures directly to the exporter material folder? if so couldn't you get the solidworks texture path through the api and use that in your export?

by the way i think using the viewport instead of the camera is a better way to go, there must be some sort of default camera in SW thats availiable before you apply a real camera to your scene.

P.S any progress on the obj material export? i get the colors to show up in sketchup but not the textures.

Oh did i mention i have a sketchup obj importer?

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

Post by jeffr » Sun Jul 29, 2007 8:01 am

To get the textured materials I have the attached files copied into the materials folder, which is in the macro's folder.

As can be seen in the first image the floor and sphere have materials assigned to them, when they are created, with the same names as the material files put into the macro's material folder.

Any part that doesn't have a material assigned looks at the colour info which was set by right clicking on the part name (second image) and selecting appearance and changing the colour. (Material files are standard Indigo materials definitions in separate files. You can make any material file and then create a material by editing materials available in solidworks.

I have already managed to get the texture info also and just have to implement it along with the other settings such as specularity, shininess etc. for the colours.
Attachments
Some_Materials.zip
Grid and knotty wood_oak materials files.
Place in ...SW_Indigo_Exporter\Materials folder.
(841.01 KiB) Downloaded 298 times
SelectingColour.jpg
SelectingColour.jpg (29.53 KiB) Viewed 8687 times
SWMaterial.jpg
SWMaterial.jpg (30.5 KiB) Viewed 8688 times

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

Post by jeffr » Sun Jul 29, 2007 8:18 am

To render just from the view there's going to be some fun math involved.
From the camera I can get the position, up and forward vectors, and focus distance from SolidWorks. These will have to all be calculated somehow using the viewport.

Anyone want the challenge of figuring this all out?

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

Post by xrok1 » Sun Jul 29, 2007 8:24 am

how about if the macro creates a camera when its run, then does the export, then deletes the camera after the export is done?

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

Post by jeffr » Sun Jul 29, 2007 8:34 am

That might work for 2006 and up.

Big Fan
Posts: 745
Joined: Tue Oct 17, 2006 9:37 am
Location: Nelson NZ

Post by Big Fan » Sun Jul 29, 2007 9:41 am

hmmm I think you should just do whatever works for you 06 and up.
I am a little behind the times.
I still have my blendigo variant that works 'ok' for me plus I can do my own UV, bump mapping and import lightwave, 3ds etc for props
How will you handle texture and bump together for instance? I think this is where 08 might have more options..

I wonder how the obj files handle curvature? (havent tried your macro yet)
In the past I have noted SW doesnt do a hot job of representing it well in vrml even winding up the resolution.
stl output can be varied well but there is no colour information..

I have been thinking of refining the .nk files I hacked together.Will you be able to use them too if I do?
Last edited by Big Fan on Sun Jul 29, 2007 10:11 am, edited 2 times in total.

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

Post by xrok1 » Sun Jul 29, 2007 9:53 am

big fan,
if you're interested in strictly obj export from SW i have a scaled down version of jeffr's code that only exports an obj but should work with SW05 because it seems to work fine without a camera. you still need to be in an assembly to export though. interested?

Post Reply
102 posts

Who is online

Users browsing this forum: No registered users and 14 guests