70001400 Create custom text on the dimension object

Article 70001400
Type Wish
Product WebJS
Version 7016
Date Added 9/24/2018
Fixed 8.8001.0.1 (10/2/2018)
Submitted by Brendan Fry

Summary

I would like to be able to set custom text on dimension object and also to set the width and height or characters in a text string. So I could set the height to 10 and the aspect ratio to .8 and then each character would be 8 in width. Also i would like to be able to 1. To set the text align 2. To use multiline text

Solution

In version 8001.0.1 new dimension variables DIMTEXT , TEXTVERJUST , TEXTHORROT was added.

Example

vdcanvas.scriptCommand.color('255,0,0');
vdcanvas.scriptCommand.dimvar('TYPE', 'align'); //Can be 'align' ,'ver', 'hor'
vdcanvas.scriptCommand.dimvar('BLK', 'vddim_default');
vdcanvas.scriptCommand.dimvar('TEXTH', '0.3');
vdcanvas.scriptCommand.dimvar('LUNITS', 'dec');
vdcanvas.scriptCommand.dimvar('PREC', '2');
vdcanvas.scriptCommand.dimvar('SZEROS', '0');
vdcanvas.scriptCommand.dimvar('LINECOLOR', 'byblock');
vdcanvas.scriptCommand.dimvar('EXTCOLOR', '0,255,0');
vdcanvas.scriptCommand.dimvar('TEXTCOLOR', '100,200,255');

// //test new added properties
vdcanvas.scriptCommand.dimvar('DIMTEXT', 'length = <>\nSome Comment1\nSome Comment2');
//default value is empty string and the formated dimension length is used
//use '<>' in the DIMTEXT in order to insert the default formated dimension length.
//use '\n' character for new line in multiline text


vdcanvas.scriptCommand.dimvar('TEXTVERJUST', 'CENTER'); //Can be 'ABOVE' or 'CENTER'. default value is ABOVE

vdcanvas.scriptCommand.dimvar('TEXTHORROT', 'HORIZONTAL'); //Can be 'ALIGN' or 'HORIZONTAL'. default value is ALIGN

Send comments on this topic.