Weirdly I'm working on a macro today that looks through all the dimensions.. I've just started so haven't got much further than creating a collection of features that have dimensions and then collecting all dimensions. I've literally just added a loop to print out the names where the value is 0.01
Dim swFeature As SldWorks.Feature Dim swDisplayDimension As SldWorks.DisplayDimension Dim swDimension As SldWorks.Dimension Dim colDispDims As Collection Dim colFeaturesWithDims As Collection Sub main() Set swApp = Application.SldWorks Set swModel = swApp.ActiveDoc Set colFeaturesWithDims = New Collection Set swFeature = swModel.FirstFeature Do While Not swFeature Is Nothing On Error Resume Next If HasDisplayDimensions(swFeature) Then colFeaturesWithDims.Add Item:=swFeature, key:=swFeature.Name Set swFeature = swFeature.GetNextFeature Loop Dim i As Integer Set colDispDims = New Collection For i = 1 To colFeaturesWithDims.Count Set swFeature = colFeaturesWithDims(i) Set swDisplayDimension = swFeature.GetFirstDisplayDimension Do While Not swDisplayDimension Is Nothing Call colDispDims.Add(Item:=swDisplayDimension, key:=swDisplayDimension.GetDimension.FullName) Set swDisplayDimension = swFeature.GetNextDisplayDimension(swDisplayDimension) Loop Next 'Check if value is 10 For i = 1 To colDispDims.Count Set swDimension = colDispDims(i).GetDimension If swDimension.SystemValue = 0.01 Then Debug.Print swDimension.FullName End If Next End Sub Private Function HasDisplayDimensions(swFeature As SldWorks.Feature) As Boolean HasDisplayDimensions = Not swFeature.GetFirstDisplayDimension Is Nothing End Function
This is very basic, just prints the dimension names to the immediate window...
what would you like it to do? automatically update the values. I've never really used HoleWizard in the API
however if you're just checking for a specific dimension value, you can already use the filter in the equations dialog
I know you're probably looking for something to go through your entire assembly,,, but this is all I have so far. It's quite fun writing these macros, but I've a long way to go
I will check these things. Curentlly I don't want to update them automatically. Just find all M10 instances in a project and then I can check these few drawings and manually update them. That is good enough for every day use.
So as I see it you want to traverse your entire assembly and check every component.
..or do you want to specify a folder and check all the files that way?
Are you working with configurations? Do you want to generate a text-file report?
I think that's all doable.. there's loads of examples in the help and a load of smart cookies on here.
Im looking forward to hear what they say
I have no special requests on how to do it. It can be with opened project main assembly and macro run or folder specification and macro run. A simple txt output with parts and assemblies specified will do. I don't work with configurations, just for sheet metal flat patterns and easier graphical presentations, but not for direct documentation purposes.