jcbarnes75 Posted March 28, 2017 Share Posted March 28, 2017 I am trying to calculate the area of a 2D polygon in square feet, independent of whatever the document units are. The "area" node only returns a value in the document units. Is there a way to specify the units independent of the document settings? Quote Link to comment
Patrick Winkler Posted March 28, 2017 Share Posted March 28, 2017 Hello, the function vs.GetUnits() returns a variable that tells how many units are one inch: fraction, display, format, upi, name, squareName = vs.GetUnits() You can create a node that returns this value. The rest should be straight forward. regards, Patrick Quote Link to comment
jcbarnes75 Posted March 28, 2017 Author Share Posted March 28, 2017 Thanks Patrick. Let me backup. How do I create a node that returns the vs.GetUnits variable? Quote Link to comment
Patrick Winkler Posted March 28, 2017 Share Posted March 28, 2017 You don't have to create a new node from nothing. I simply hijacked the any-node. @Marionette.NodeDefinition class Params(metaclass = Marionette.OrderedClass): this = Marionette.Node( 'UnitsPerInch' ) v = Marionette.PortOut() v.SetDescription('The resulting value') def RunNode(self): fraction, display, format, upi, name, squareName = vs.GetUnits() self.Params.v.value = upi 1 Quote Link to comment
jcbarnes75 Posted March 28, 2017 Author Share Posted March 28, 2017 Ah, I was just starting to do that. Thanks for your help. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.