Is there a way in SW2013 to set the "horizontal cell padding" within a macro?
Are you looking to do a dimension (HorizontalJustification) or text in a cell (CellTextHorizontalJustification)
In a table cell edit, I'm looking to set the distance in the - what the tool tip says is - horizontal cell padding. I can honestly find no reference to that textbox anywhere in the API information.
Hi Dave not sure if there is way to do it for specific table or cell but you can set it globally for tables using API
Yes (though it doesn't work well). If you search the Solidoworks help for "swDetailingTablesVerticalPadding" you will find reference to this document setting in the API. Also, if you record a macro, you'll get something like this.
Dim swApp As Object
Dim Part As ObjectDim boolstatus As BooleanDim longstatus As Long, longwarnings As Long
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDocboolstatus = Part.Extension.SetUserPreferenceDouble(swUserPreferenceDoubleValue_e.swDetailingTablesVerticalPadding, 0, 0.0031242)End Sub
That said, I am finding it very frustrating to use. This method above will set the doc properties. But it doesn't see to affect existing tables. I have not yet figured out how to set padding for cells in existing tables. If you figure it out, let me know.
So, I've been working on this some more. Here's what I have found:
You can set the cell paddings for all future tables in Document-Properties//Drafting-Standard//Tables//Cell-Padding. The above code will do that.
I have a macro that creates a rev table after running the above code and the new rev table has the correct padding.
I have another macro that creates a general table, but in this case, the Horizontal padding is correct, but the Vertical padding is .001
This seems to be a problem that users have complained about for more than a decade.
Retrieving data ...