nishan
nishan

Reputation: 1

Autodesk Forge Viewer Markup Style Object

I referenced http://autodeskviewer.com/viewers/latest/docs/tutorial-feature_markup.html , Philippe leefsma and Augusto tutorials. There is some difficulty in implementing style attributes in markup. Could you suggest on fixing it. enter image description here

Upvotes: 0

Views: 1437

Answers (2)

Eason Kang
Eason Kang

Reputation: 7115

Please accept our sincere apologies for the delay, we have a backlog in the queue.

I found there something changed in the MarkupCore shipped with the recent viewer. This documentation http://autodeskviewer.com/viewers/latest/docs/tutorial-feature_markup.html you're looking is too old to reflect those changes. Plase use following code snippet:

// Confiurate styles
var styleAttributes = ['stroke-width', 'stroke-color', 'stroke-opacity'];
var nsu = Autodesk.Viewing.Extensions.Markups.Core.Utils;
var styleObject = nsu.createStyle(styleAttributes, markupExt);
styleObject['stroke-width'] = 10;

// Set style up
markupExt.setStyle(styleObject);

The 2nd parameter of the createStyle is the loaded instance of the MarkupCore extension, it's not viewer anymore. Hope it helps.

Upvotes: 3

Felipe
Felipe

Reputation: 4375

Take a look at my latest sample. The source code is available at Viewing.Extension.Markup2D and the live demo is here. No issue to change markup styles.

Upvotes: 0

Related Questions