This is certainly possible. Using API calls like IDesignTable::EditTable2 you can get a pointer to the Microsoft Excel worksheet in order to edit it. Likewise, you can get the clearance distance between two components using IDragOperator::Clearance.
If you're looking to write this yourself and you're completely new to macros, I would recommend you check out the resources in the link below. You might also benefit from this article to make your learning more efficient: 7 Mistakes New SolidWorks API Programmers Make
Thank you, that was very helpful. However, I'm going to hold off on clicking correct answer until I've had a chance to write the macro.
I've finally found time to start writting this macro and unfortunately have gotten a bit stuck. I can't seem to get the IDragOperator::Clearance call to work correctly. Most importantly I'm not sure what to put in as the parameter to get the clearance between the correct components. The API help tells you to put in a single integer as the "index of the components".
At the moment the value that the clearance call is giving me prints out as: -1.#INF
Below is the portion of the code that selects the appropriate components, attempts to get the clearance between them then clears the selection.
If intCurCol = 1 Then
strActColNam = "COLLAR_FDT_ClearTest-1@Float Displacement Param Model"
strActColNam = "COLLAR_FDT_ClearTest-2@Float Displacement Param Model"
boolStatus = swFDmodel.Extension.SelectByID2(strActColNam, "COMPONENT", 0, 0, 0, False, 0, Nothing, 0)
Debug.Print "1. " & boolStatus
boolStatus = swFDmodel.Extension.SelectByID2("CRC - MTRC_model-1@Float Displacement Param Model", _
"COMPONENT", 0, 0, 0, True, 0, Nothing, 0)
Debug.Print "2. " & boolStatus
swDragOp.DynamicClearanceEnabled = True
dblTreadDist = swDragOp.clearance(1)
Thank you in advance,
Have you tried the ClearanceVerification tool? swCommands_ClearanceVerification
Thanks for the suggestion David,
Perhaps I should have posted earlier that I was able to get the functionality I was looking for by using the ClosestDistance method.