API calls for Photoworks.

Where the heck are they documented. I want to modify a material setting. I am trying to adjust the the transparency of a part using the a macro feature instead of using animator. I can't seem to get both the ability to fade in a part and have it maintain mirror properties. It seems that if the mirror levels are set above zero the part never fully disapears. Other suggestions are welcomed but I sure would like to know what calls are available.

Corey Scheich

Reply to
Corey Scheich
Loading thread data ...

I thought the setting "Record actions to macro files" would record some API calls, however the only one that worked was...

result = swApp.CallBack("pworks@MiEval", 0, "Render")

It recorded this when I hit 'Render'. Render to file records something as well.

Sorry I couldn't find what you needed. I would be interested in the answer as well!

Mike Wilson

Reply to
Mike J. Wilson

Great Mike if you don't know it I don't know who will. :^( Documentation would be nice. They have it for all the Addins I don't need but the 2 I would love to have and that would save the most time nothing (PhotoWorks and Animator.)

Corey

Reply to
Corey Scheich

Are you enrolled in the 2005 beta program? If you go to the forum, and to the API section, there is some more info there. I posted the question for you and it got answered, though it's depressing news.

Mike Wilson

Reply to
Mike J. Wilson

Unfortunately NO but that is as I expected maybe there will be some hope by the final release. I was hoping I could fade a chromic part in and out but I guess it will be another day or year, release anyway I put in an enhancement request if enough get in they may put some priority on it.

Corey

Reply to
Corey Scheich

actually, there are a couple calls that you can use. Unfortunately, most of the API is unavailable. All of the good stuff like picking materials, scenes, etc. if not open. I have found some success by setting up template files with the correct scene and just running the render using the following code:

Dim FileNameParm As String = "RenderToFile Filename " & TargetDirectory & "\" & ActiveFile & ".bmp"

result = swApp.CallBack("pworks@MiEval", 0, FileNameParm)

result = swApp.CallBack("pworks@MiEval", 0, "RenderToFile Format bmp")

result = swApp.CallBack("pworks@MiEval", 0, "RenderToFile Size 320 344")

result = swApp.CallBack("pworks@MiEval", 0, "RenderToFile Render")

This code will generate the file. The biggest problem with this method is that you cannot use a directory with a space in the name.

There are some other commands you can use, but I have them in a document from SW corporate. Email me and I'll be glad to email it directly.

Reply to
Evan T. Basalik

Corey, I really suggest that you download the beta. Registration is almost instant and you can download right away. The reason I say this is because, as you can imagine, the SolidWorks add-ins are always being improved in one way or another. I think you may find an easy answer to your problem.

Unfortunately, I can't talk about it in public or they will have me killed ;^)

Mike Wilson

Reply to
Mike J. Wilson

Photoworks is made by Mental Image

formatting link
The miEval function just takes mental ray-ish commands and executes them. Photoworks must be a custom (amd stripped down) release of mental ray. I found a manual here:

formatting link
If you are a hacker at heart you could try eval'ing some of the other commands in Section 4.6 and see what happens. I'd love to hack around, but I don't have Photoworks :o(

The 'RenderToFile' command is not documented here, so Photoworks may be quite different. It wouldn't surprise me if some of these worked however. I'm sure there are other commands much more powerful than a simple eval of a string - but you'd have to ask Solidworks for them. Best to get in on the Beta as Mike suggested.

Markus.

Reply to
Markus Wankus

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.