SolidWorks Exporter
o.k i tried a different .ASM here's what i got. but i still can only get the geometry_export to work . below is debug report when trying idigo_export.
P.S where is the geometry actually created because i can't seem to find it?
P.S where is the geometry actually created because i can't seem to find it?
- Attachments
-
- geometry_export
- Capture4.JPG (216.23 KiB) Viewed 8864 times
-
- indigo_export
- error5.JPG (46.66 KiB) Viewed 8864 times
The section you show is where the geometry is extracted.
Simplified the assembly is 'traversed' from one part to the next. Tessalate converts the geometry. The xyz points are in an array which is then written to the file.
Have you tried making another macro button on the toolbar for the other macro that isn't working for you? Maybe it's another one of those strange things going on.
Simplified the assembly is 'traversed' from one part to the next. Tessalate converts the geometry. The xyz points are in an array which is then written to the file.
Have you tried making another macro button on the toolbar for the other macro that isn't working for you? Maybe it's another one of those strange things going on.
The one macro exports an obj for the geometry and an Indigo file for the scene set up, lights, materials etc. The other exports completely into an Indigo file (using igs as in an indigo file even though igs is already a 3d format. Indigo really should use a different extension to avoid confussion )
If you use the SW_Indigo_Export it exports the obj and sets the indigo file to use it. If you use the Indigo_Geometry_Export it exports the geometry in the indigo file. Going from one macro to the other will overwrite the indigo file.
I haven't decided which version is the best route yet. With exporting the obj I originally had some issues but I think I've overcome that and can go that way and still get the results I want but that needs more testing. That's why I've put both versions up.
If you use the SW_Indigo_Export it exports the obj and sets the indigo file to use it. If you use the Indigo_Geometry_Export it exports the geometry in the indigo file. Going from one macro to the other will overwrite the indigo file.
I haven't decided which version is the best route yet. With exporting the obj I originally had some issues but I think I've overcome that and can go that way and still get the results I want but that needs more testing. That's why I've put both versions up.
i think the obj option is a much better way to go. it kills 2 birds with 1 stone because SW doesn't currently offer obj export and this would open up a world of possibilities for post SW work such as sds and freeform edits in a less constrictive environment, pre render.
on a side note now that you've explained, its the indigo exporter that works for me not the obj exporter. sorry for the confusion. have you considered renaming your macros to SW_Indigo_Export.swp and SW_Indigo_obj_Export.swp might be a little less confusing.
on a side note now that you've explained, its the indigo exporter that works for me not the obj exporter. sorry for the confusion. have you considered renaming your macros to SW_Indigo_Export.swp and SW_Indigo_obj_Export.swp might be a little less confusing.
Assuming this is the version that doesn't export obj. I'm wondering what's different. It has been working for me except for the odd part would cause some problem.xrok1 wrote:i can only get it to work if i change (tess.GetVertexNormal(i)) to (tess.IGetVertexNormal(i)) but then the normals are all screwed?
The error would report a problem at line 0 column 0 according to Indigo. Not sure what the difference is between the parts. I've recreated the part and it would be fine.
this is from the obj export version it does export a nice obj if i change this code (looks good in HEX 2.2)but like i said the normals are wrong so it won't render properly.
i tried making a hybrid by adding the appropriate code from the obj version so that the igi version would export an obj while its doing its stuff because it deals with normals fine, but then i get an error @ 55Open FileName + ".obj" For Output As 1? if i skip that one line in the debugger everything else completes it just won't open the .obj or create it.
i'll attach the swp so you can see it, then maybe you could try getting rid of the strickly igi exporter to make communication about this topic a little easier.
[/i]
P.S i like the idea of choice of renderers as well but don't tell anyone
i tried making a hybrid by adding the appropriate code from the obj version so that the igi version would export an obj while its doing its stuff because it deals with normals fine, but then i get an error @ 55Open FileName + ".obj" For Output As 1? if i skip that one line in the debugger everything else completes it just won't open the .obj or create it.
i'll attach the swp so you can see it, then maybe you could try getting rid of the strickly igi exporter to make communication about this topic a little easier.

P.S i like the idea of choice of renderers as well but don't tell anyone

- Attachments
-
- SW_Indigo_Export_Hybrid.zip
- (161.06 KiB) Downloaded 316 times
Haven't had a chance yet to look at what you did but I will (have to sneak it in here at work. shhhh!
).
The original code was just exporting the obj and it worked great but I ran into issues with creating and using materials so I went fully Indigo. Obviously messed something up with the obj export.
I think we can go back to exporting the obj but I'm pretty sure we'd have to export each part as a separate obj rather than one all inclusive bigger file, to avoid the materials issues I was having.
I started arranging the code to do that last night so should be able to get it to you tonight.

The original code was just exporting the obj and it worked great but I ran into issues with creating and using materials so I went fully Indigo. Obviously messed something up with the obj export.
I think we can go back to exporting the obj but I'm pretty sure we'd have to export each part as a separate obj rather than one all inclusive bigger file, to avoid the materials issues I was having.
I started arranging the code to do that last night so should be able to get it to you tonight.
your code already exports with seperate objects and materials; sort of. if you open one of the obj files in Hex or Carrara their are seperate objects and materials their just all the same color. so it looks like the mat domains are there but the default material is applied to them for some reason.
P.S if you change your export scale to 39.3738 its just about perfect. if you're in inches in SW that is. but i think that what most of us work in anyway.
P.S if you change your export scale to 39.3738 its just about perfect. if you're in inches in SW that is. but i think that what most of us work in anyway.
The reason I'm thinking export separate obj's is because I haven't figured out how to get Indigo to take the uv coordinates with a single file.
This isn't important to get most materials but any that use an image map for the texture or a bump map we need it.
With the scale, I found that the output values need to be a certain range of values for the best image so I'm trying to set the scale based on the numbers rather than the actual units being used. I tried it with the units but depending the size of the scene and camera positioning I found I had some bad results.
This isn't important to get most materials but any that use an image map for the texture or a bump map we need it.
With the scale, I found that the output values need to be a certain range of values for the best image so I'm trying to set the scale based on the numbers rather than the actual units being used. I tried it with the units but depending the size of the scene and camera positioning I found I had some bad results.
maybe you could make the obj and igs exports use different scales, scal1 and scal2, best of both worlds.
this was the idea of the hybrid, think of each file(obj &igs)as a seperate process not dependent on oeach other. that way you can concentrate on making an obj thats a good obj because the igs is still produced and sent to indigo at the same time.
this was the idea of the hybrid, think of each file(obj &igs)as a seperate process not dependent on oeach other. that way you can concentrate on making an obj thats a good obj because the igs is still produced and sent to indigo at the same time.
I've updated the file again.
Now the zip file only contains the version that exports geometry as an obj file.
The UV's are working so there's just some work to do on using the solidworks appearance call outs to create materials within sw.
Give it a try and see what problems you come up with.
I provided a box to enter the scale in. I will give it the ability to remember what scale you used the last time it run so it's not a pain every time you call it up.
Cheers
Jeff
Now the zip file only contains the version that exports geometry as an obj file.
The UV's are working so there's just some work to do on using the solidworks appearance call outs to create materials within sw.
Give it a try and see what problems you come up with.
I provided a box to enter the scale in. I will give it the ability to remember what scale you used the last time it run so it's not a pain every time you call it up.
Cheers
Jeff
Who is online
Users browsing this forum: No registered users and 1 guest