It looks like EditDimensionProperties2 has been deprecated.
The documentation for the lastest version is here:
- Type of tolerance as defined in swTolType_e
- Maximum value for the tolerance
Minimum value for the tolerance
Text for the maximum FIT value when using a fit tolerance type
Text for the minimum FIT value when using a fit tolerance type
True to use the document's precision value, false to use value specified for precision
- Precision value to use for this dimension if UseDocPrec is false
Value for the arrow direction as defined in swDimensionArrowsSide_e
- True to use the document's arrow types, false to use values specified for Arrow1 and Arrow2
Type of arrow to use on the first arrow of this dimension as defined in swArrowStyle_e if UseDocArrows is false
- Type of arrow to use on the second arrow of this dimension as defined in swArrowStyle_e if UseDocArrows is false
Text for the prefix of the dimension
- Text for the suffix of the dimension
True to display the value of the dimension in the user interface, false to not
- Callout text to display above the dimension
- Callout text to display below the dimension
True if you want to center the text in the dimension, false if not
Configuration options as defined swInConfigurationOpts_e
- Names of configurations to which to apply these edits (see Remarks)
True if the dimension is modified, false if not
According to the documentation, in order to edit dimension properties, you need to specify all of these things in the function call EditDimensionProperties3. There may be a more direct way of changing the precision but I'm not aware of it.
The documentation page gives an example of the usage syntax in VBA.
Thanks, I have seen this and it is not any help. I am still using editdimensionproperties2 because when I record a macro and do the functionality that I want 2 comes up not 3.
It does not seem like either 2 or 3 can get the individual information out of this function....lame. Solidworks fix this please.
I think I misunderstood your original post. Are you trying to assign the precision or figure out what the current precision is?
Regarding the macro recorder, the problem that you are having is a symptom of relying on it. There is a more direct way of getting and setting dimension properties. The one that you are using exposes the selected dimension through the iModelDoc2 interface. If you manage to get a reference to the iDisplayDimension 2012 SOLIDWORKS API Help - IDisplayDimension Interface Members (I'm assuming that you are dealing with a dimension on a drawing) you can get and set the precision more directly.
You can find methods that will expose this iDisplayDimension on the interface page. Each object has a "Members" page which lists members/methods and an "Interface" page which will describe (among other things) how to get a reference to that object.
Hmm, this page might help if I can use these commands to get the information I need. Yes, I want the macro to "know" how many decimal places(precision) a clicked/active dimension has. This way I can make a macro to either increase or decrease the decimal places.
I could not find a way to tease out the information as the EditDimensionProperties2 operator is more a call to a function that I can't access I guess.
I will have to mess with the GetPrimaryPrecision2 command.
I am not sure what the IDisplayDimension means at all....nor can I find something that explains it...simply.
Dim instance As IDisplayDimension
Dim value As Integer
value = instance.GetPrimaryPrecision2()
As I understand it, an iDisplayDimension is the object that you see. It contains an iDimension. The iDimension contains the actual raw value and the tolerance whereas the iDisplayDimension contains characteristics relevant to displaying those things: the position, things it is attached to, precision, etc. (contains may not be the right word as these objects merely expose Solidworks objects' interfaces. I haven't fully wrapped my head around what this means or how it works.
There are a few ways of getting a reference to the iDisplayDimension. In the API documentation, every object has a list of Accessors. I believe the list is exhaustive. Check that list out for iDisplayDimension 2012 SOLIDWORKS API Help - IDisplayDimension Interface.
Most of these are methods that actually create an iDisplayDimension and return a reference to it. If you want to check and set the precision on existing iDimensions, you need to traverse the interface objects that will get you there. the hierarchy on a drawing usually goes something like this (may not compile):
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swDraw As SldWorks.DrawingDoc
Dim swView As SldWorks.View
Dim swDisplayDimension As SldWorks.DisplayDimension
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Set swDraw = swModel 'actually a necessary step
'loop over the views
Set swView = swDraw.GetFirstView
While (Not (swView Is Nothing)) 'Replace with some condition that indicates that you've explored all views
For Each vDisplayDimension In swView.GetDisplayDimensions
Set swDisplayDimension = vDisplayDimension
'do what you will with it
Set swView = swView.GetNextView 'get the next view
'there are also methods that will return a variant array of views that can be looped over the structure
' of the returned array is confusing enough to prevent me from demonstrating it here quickly.