Skip to main content
Participant
December 17, 2021
Answered

setting the object size in an objectsyle with javascript

  • December 17, 2021
  • 3 replies
  • 363 views

Hi,

I want to set the size of objects in the objectstyle with javascript.

How can this be done?

This topic has been closed for replies.
Correct answer brian_p_dts

I believe they are set under myStyle.transformAttributeOptions;

 

You must also enable the attributes with myStyle.enableTransformAttributes = true;

3 replies

Participating Frequently
July 25, 2023

Maybe I don't understand the scope, but you can set the size of an object with the objectstyle itself.

rob day
Community Expert
Community Expert
July 25, 2023

Hi @janh24813240 , i think you may have missed that the original post was a question about automating the creation of an Object Style with JavaScript. Brian was referring to the JS code for setting the object size, not the Object Style UI.

brian_p_dts
Community Expert
brian_p_dtsCommunity ExpertCorrect answer
Community Expert
December 17, 2021

I believe they are set under myStyle.transformAttributeOptions;

 

You must also enable the attributes with myStyle.enableTransformAttributes = true;

m1b
Community Expert
Community Expert
December 17, 2021

Good question. I had a quick look and size/position doesn't seem to be exposed via the scripting API. I hope I'm wrong.

EDIT: actually it is there.. see Brian's answer!

- Mark