Does anyone know the code to change the position of an existing dimension/balloon in a drawing using API. I tried recording a macro and changing the position of an existing position but not sure what to edit in that form or if I am missing a piece of code.
boolstatus = Part.Extension.SelectByID2("RD1@DV2", "DIMENSION", 0.09981805854007, 0.1594310762463, 0, False, 0, Nothing, 0)
Thanks,
James
SolidworksApi macros
<p>James Gannatal wrote:</p><p></p><p></p><p>boolstatus = Part.Extension.SelectByID2("RD1@Drawing View2", "DIMENSION", 0.09981805854007, 0.1594310762463, 0, False, 0, Nothing, 0)</p><p></p>These values 0.09981805854007, 0.1594310762463, 0, in the code represents X Y and Z coordinates in meters. So need to modufy them for a new position
Deepak,
Figured thats what those values represented but tried modifying them and the macro would select that dimension but would not move it to the designated position.
James
Use the IAnnotation::SetPosition method. API help file has sample code.
http://help.solidworks.com/2011/English/api/sldworksapi/SolidWorks.Interop.sldworks~SolidWorks.Interop.sldworks.IAnnotation~SetPosition.html
Oh sorry, I should have mentioned that you need to use SetPosition
You wouldn't happen to have an example using SetPosition to move the position of a dimension.
Here is example of using setposition.
http://help.solidworks.com/2011/English/api/sldworksapi/Insert_a_Note_Example_VB.htm
Thanks everyone,
SetPosition works perfect.
Thanks,
James