I want to move dimensions in my drawing. Being self-taught on SolidWorks macros, I use macro recording to guide me, but here I stumble. Indeed, following the movement of a dimension, the recorded macro returns me:
boolstatus = Part.Extension.SelectByID2("Drawing D1@Vue 1", "DIMENSION", 8.08807508164743E-02, 0.118580499912683, 0, False, 0, Nothing, 0)'Position of the dimension when moved
I therefore conclude that the numbers in bold define the position of the dimension. However, when I run these command lines, even if the number changes, the dimension doesn't move at all. I must be taking it badly. Could you help me?
In fact the instruction used is SELECT: so it's only used to select the dimension!
To move it, you have to use SETPOSITION: http://help.solidworks.com/2011/English/api/sldworksapi/SolidWorks.Interop.sldworks~SolidWorks.Interop.sldworks.IAnnotation~SetPosition.html
Thank you ".PL" for your answer, I'm looking for how to use "SETPOSITION". I admit to having a bit of trouble but I'm only at the beginning of my research.
To answer the question about the usefulness of moving the position of a dimension in a MEP, it is in fact a question of always positioning dimensions in the same place, which changes position according to the dimensions of the part while keeping the same name. More precisely: I have a part with several active or non-active functions and dimensions that also change. Everything is configured from an Excel file that runs a macro that places the right dimensions of each dimension. I don't use room families. Once the import of these dimensions and functions active or not, the part is rebuilt and imported into my MEP. Dimensions are also imported but appear randomly (even with the "as on sketch" option). So I decided to fix their position on the plan. Because the average user just needs to configure the Excel file and have a printable plan without having to reposition dimensions.
Thank you for your suggestions, however I have already tested many of the software possibilities on the import or formatting of dimensions and none of them allow a standardized result that can be used without retouching, in fact the automatic dimensions overlap and do not appear in compliance with the rules of industrial design. This just makes it possible to rough up the display but not to make it standardized. In addition, I also have angular dimensions which are the worst to import automatically, because depending on the angle, the dimension can be at the other end of the plane^^
I'm still trying to use "SetPosition" but I'm struggling with declarations. If anyone has a simple example, which would take for example the selection of a dimension with the name "N" and a position "X,Y" to make it go to the position "X',Y'" I am interested ^^