I am currently working on an addin for solid edge which should export the current users projects as an STL file, temporarly save it locally to upload it through a http post request to a server.
Right now I am stuck in the first part. I set up a GUI button already, but doesnt have any functions. I love the addin.doc and SDK, since it helps me a lot but couldnt really figured out how to reference the current projects (for instance 3D model) the user is editing. Cause when the user presses the button, the current view (document) should be exported as a stl. Some suggestions? Does the framework has a method for exporting the models to stl and save it locally?
Thanks in advance, I am new to the API so I am currently working on understanding the infrastructure. If you have any advice or sketches that would be pretty awesome.
Solved! Go to Solution.
Thank you very much Jason!
I am working with your projects on codeprojects, they are very good I still have to study the API and SDK since its not that easy to understand the architecture in terms of which classes represent what kind of object (Unfortunatly I am more the visual learner..)
Also its kind of hard to figure out what exactly is the toolbar, edgebar, etc.. but I think thr fact that I never used SolidEdge before is the reason for that.
I want to do the addin in c++. It would be great if you give me some advice or hints.
I already responded on how to save-as STL. Once you get your addin sinked to the ISEAddInEventsEx event set, you can respond to the button click in the OnCommand event. An example can be found in MyAddin.cpp on line 153.
Thanks Jason, I studying all your tutorials and they help me a lot!
Right now I am stuck with your suggestions two replies before.
You suggested: Application -> ActiveDocument -> SaveAs("NewFile.stl")
I tried: (In commands.cpp after pushing the commandbutton)
But in Active Document there isnt such a method as "Save as"
do you have other suggestions?
The ActiveDocument property returns a generic IDispatch pointer, so you will have to query the SolidEdgeDocument interface on it to access the SaveAs method.
This can be easily done in a single line, if you are using COM smart pointers in C++:
SolidEdgeDocumentPtr pSEDoc = pApp->GetActiveDocument(); pSEDoc->SaveAs("Newfile.stl");