Rather than triggering the macro from the exe, I would include the relevant code from the macro in the exe. This will be aided by the fact that I worked to keep the user interface separate from the data model. It will be hampered by the fact that I included no comments about what was happening where in the code.
You should be able to export the DrawingModel class module out of the macro and into your application. Then you will need to get two instances of DrawingModel, one for the drawing and one for the model (part / assembly). Then you can get the properties from the model one and set them in the drawing one.
Assuming that [tt]drawing[/tt] is a [tt]SldWorks.DrawingDoc[/tt] for the current drawing the following code will get the property model for the drawing.
Code:
Set drawingPropertyModel = New DrawingModel
drawingPropertyModel.setTo drawing, "", drawingPropertyModel
Getting the property model for the part / assembly is similar, but more complex. The complexity comes from two sources: a drawing can have multiple views which reference different models, and the desired properties can be associated with either a model file or an individual configuration. Assuming that you want to use the file properties from the current view of the current sheet of the drawing you would use the following code to get the DrawingModel object for the model.
Code:
Dim currentView As SldWorks.view
Set currentView = drawing.GetFirstView()
Set currentView = currentView.GetNextView
Set modelPropertyModel = New DrawingModel
modelPropertyModel.setTo currentView.ReferencedDocument, "", modelPropertyModel
If you want the configuration properties the last line would become:
Code:
modelPropertyModel.setTo currentView.ReferencedDocument, currentView.ReferencedConfiguration, modelPropertyModel
Then it is a simple matter of:
Code:
Dim number As String
Dim description As String
modelPropertyModel.getModelProperties(number, description, False)
drawingPropertyModel.setModelProperties(number, description, False)
I hope this is enough information so that you can work out the integration.
Eric