Newbie API user - how do I constrain a SketchText?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Using the API I located an 'anchor point' on my sketch (2mm down and right of the top left point shown in the image below), and a SketchText ("F0"). I could not find any guidance in the API documentation or code samples, or samples on the internet, to apply the constrains to the SketchText that I wanted:
I could however apply them through Fusion's UI:
UI Action 1 - Coincidence Constraint:
I can set a coincident constraint between my 'anchor point' and the top-left green 'control point' of the SketchText's dotted 'boundary frame':
<---before and after --->
UI Action 2 - Horizontal Constraint:
Through the UI I can set a horizontal constraint for the top horizontal line of the SketchText's dotted 'boundary frame':
<---before and after --->
UI Action - Dimension
Through the UI can dimension the left vertical line of the SketchText's dotted 'boundary frame':
<---before and after --->
Being new to the API my idea was to simply replicate the above actions through the API. If this is a reasonable approach can anyone guide me in how these can be achieved. Alternatively, is there is a better way to achieve similar results through the API's exposed interfaces?
The actions above still leave the right hand vertical edge unconstrained, but I do not want to lock this with a horizontal dimension as typing additional text causes soft line breaks to be added. I am happy to alter the text and simply drag the left hand vertical line until the line breaks disappear, unless someone has a neater solution.
Thanks in anticipation.