lenght of a curve
All  1-5  6-7

Previous
Next
 From:  Michael Gibson
5205.6 In reply to 5205.5 
Hi nos,

> But it seams not to work cause of the moi.get.ui part. So how should it look
> like? I tried the following but it don't doing anything:

The moi.ui.getUIPanel() part returns back a variable that you would then use as the place to insert HTML into.

Right now you're calling it and not actually doing anything with the returned variable, you'd need to do something more like:

var panel = moi.ui.getUIPanel( '...' );

panel.document.body.insertAdjacentHTML( .... )



> And instead of the "CommandBar.htm" what would be the name of the ui-block which
> displays the element name, style, and dimension?

That's inside of the Side pane - that can be retrieved by:
moi.ui.getUIPanel('moi://ui/SidePane.htm')


Then the part that displays the object properties is an element nested a fair ways down inside the side pane, the container of it has id="PropertiesPanel".


It will be kind of difficult to make a properly behaving readout in there though with just some shortcut key code doing it, because if you display the value by modifying the HTML your modifications are going to be stuck there all the time after that, and having old values stick there could be bad since it could pretty easily lead to you thinking that some old value was actually the length of the current selection. The "CurveLengthBeingDrawn" script basically avoided that problem because it put its stuff into the command UI document, which is a document that is created fresh when a command is run and destroyed when the command exits (it holds all the UI specific to each individual command), so it sort of automatically clears out. The place you're wanting to add stuff to only gets hidden and shown, not actually cleared out and so you'll have the problem of whatever you put in there sticking around.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  Michael Gibson
5205.7 In reply to 5205.5 
Hi Nos, so really instead of trying to set up a script that will modify the UI like that, I'd instead recommend installing the UnwrapCurve plugin from here:
http://moi3d.com/forum/index.php?webtag=MOI&msg=5136.1

Then when you want to know the length of a curve, select it and trigger your shortcut for UnwrapCurve, that will generate a line of that length and if you want to know the numeric length just select the line and for lines the length of the line is displayed in the properties panel size line already.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All

 

 
 
Show messages: All  1-5  6-7