Construction line script
 1-13  14-33  34-48

Previous
Next
 From:  Paul (AIRGLASS)
1029.14 
And on the silly side of things.....
If someone's got the AutoRotate2 script installed, here's a time waster :
activate the construction line script
draw a few lines in each viewport
click a viewport to keep the lines and exit
maximize the 3d viewport
turn on the autorotate2 script

and it's

MoI -- "It's a screensaver too!"

Paul
  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
Next
 From:  Schbeurd
1029.15 In reply to 1029.13 
@ Paul,

Another excellent script here ! It's really cool to have permanent construction lines ! ;-)

@ Michael,

>>> In version 2 I would like to make it possible to lock objects to prevent them from being selected, but remain snappable. At that time you would be able to draw a circle, set it to have a dashed line style, and then lock it and that would end up being the same thing as a construction circle.

Yeah ! Good idea. It's similar to a feature in Illustrator. I'd really like to see your "feature list" for V.2... ;-))
  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
Next
 From:  Dymaxion
1029.16 
So, it's been quite a while and I'm assuming the code has bit-rotted a bit, but I'm trying to use the ConstructionLine.js script from this thread, and when I try to launch it, I get a JScript error, "Object expected Line 6: Column 1". I'm fairly certain it's set up correctly, and I can't figure out which line it's talking about. Ideas?

/Ella
  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
Next
 From:  Michael Gibson
1029.17 In reply to 1029.16 
Hi Ella - which version of MoI are you trying it on?

I just tried it over here with the latest v2 beta (Apr-12-2009 release) and it seems to work fine for me.

You mentioned the "ConstructionLine.js" script - do you mean you only have that one file? There should be 2 files included in the .zip, a .js file and an .htm file.

You'll need to copy both of those files (not just the .js file) to your \commands sub-folder, then set up a shortcut key that says: ConstructionLine as the command.

Let me know if you've done all that and still have problems.

- 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
Next
 From:  Dymaxion
1029.18 In reply to 1029.17 
Current beta. I was trying to link to the command as "ConstructionLines.js"

Here's a slightly cleaned up version of the code script, with instructions for adding it to a conveniently empty slot in the "Edit" tab.

It'd be nice to have a "Done" button for the script, instead of the "click on the viewport" bit, which is a bit too easy to trigger accidentally. I know this is kind of abusing a line factory to make things work; is it possible to create that behavior?


EDIT (7/11/2015): The attached instructions are for v2 - for MoI v3 the way icons are set up on buttons is slightly different and so for setting up the button in v3 put in this instead:
code:
<td><moi:CommandButton icon="icons/CLIcon.png" command="ConstructionLine">CLine</moi:CommandButton></td>

EDITED: 11 Jul 2015 by MICHAEL GIBSON

Attachments:

  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
Next
 From:  Michael Gibson
1029.19 In reply to 1029.18 
Hi Ella,

> It'd be nice to have a "Done" button for the script, instead
> of the "click on the viewport" bit, which is a bit too easy to
> trigger accidentally.

Give the version attached here a try - I added a Done button to this version. This one won't exit if you just click with a left-click, you end it by clicking the Done button or using one of the shortcuts for Done (right-click in a viewport or the Enter key).

The line factory part wasn't actually doing anything here, I think it was some left-over remnant from this having started out originally as a modification of the line command or something like that.

The actual meat of creating the construction lines was happening inside the GetPoint() call, which is set up to wait until a point is picked and then return. In this version I replaced that call to a manual event loop so it can respond to getting the "done" event.

Let me know if this one doesn't do what you wanted.

- Michael
Attachments:

  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
Next
 From:  Satoribomb
1029.20 In reply to 1029.19 
Ah thank you Michael! The script and instructions worked flawlessly for me (an HTML challenged soul). THis will help enormously with my current projects. Will this CLine script function/feature become a permanent part of MoI going forward or will it remain an end-user add-on?
  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
Next
 From:  Michael Gibson
1029.21 In reply to 1029.20 
Hi Satoribomb, I'm glad you got it all set up!

At the moment I'm just planning on having this as an optional add-on. In the future I would like to make it easier to manage plug-ins though.

- 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
Next
 From:  Dymaxion
1029.22 In reply to 1029.19 
Yes, it's great! Thanks for the update. One more question -- is it possible to have undo work while editing CLines? I.e., I lay down two lines, hit undo, have the most recent one go away, and then lay down another?
  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
Next
 From:  Michael Gibson
1029.23 In reply to 1029.22 
Hi Ella,

re: undo for clines - it's possible to set up a script that will remove the last placed cline, so that may work as a general "cline undo" that you could use either in this custom command or also at any other time you make a cline as well.

Setting up this script on a shortcut key should handle that:

script:var gd = moi.geometryDatabase; var clines = gd.getObjects().getConstructionLines(); if ( clines.length > 0 ) gd.removeObject( clines.item(clines.length-1) );

It should also be possible to alter this custom ConstructionLine command to have a "command-specific undo" in it which would allow it to respond to an undo event so it could handle a custom undo action during the command and it could do the same thing as above to remove the last entered cline. Let me know if you want me to make a new version that has that set up. But the shortcut key above is more general purpose since it will let you get rid of the last cline you created at any time, even if you are creating one while running some regular draw command instead of this special ConstructionLine command.

- 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
Next
 From:  Dymaxion
1029.24 In reply to 1029.23 
Yeah, I've seen the first command before. The command-specific undo is closer to what I was thinking of, but ideally, I'd want it to be triggered by the same keystroke/button as any other undo. It currently works in batches while outside of the command, which is fine, but the actual undo keystroke doesn't work at all inside the command. Would the command-specific undo bind to the standard undo keystroke?

/Ella
  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
Next
 From:  Michael Gibson
1029.25 In reply to 1029.24 
Hi Ella,

> Would the command-specific undo bind to the standard undo keystroke?

Yeah command-specific undo can be set by a command so that if an undo is triggered (by whatever method - either by ctrl+z or by clicking on the undo button), it will receive a custom event for it rather than the standard undo happening.

Attached here is another updated version of the ConstructionLine command that now has a command-specific undo set on it, so with this version you can hit Ctrl+Z or the undo button on the bottom toolbar to remove the last placed cline.

- Michael
Attachments:

  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
Next
 From:  Dymaxion
1029.26 In reply to 1029.25 
Perfect! Thanks much.

/Ella
  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
Next
 From:  bemfarmer
1029.27 
Just installed the cLine script in Moi3, and in Moi2.
Found that the instruction for installing the Icon for ConstructionLine3.zip,
for Moi3beta (windows), needs to be slightly different from the Moi2 version.

Replace empty slot in SidePane.htm:EditTabContent with: (just showing the changed portion because I
forgot how to label code, as code.)

Moi2 version.
...CommandButton style="icon:icons/CLIcon.png;"

Moi3 version.
...CommandButton icon="icons/CLIcon.png"

(Please correct if this is in error)
  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
Next
 From:  Michael Gibson
1029.28 In reply to 1029.27 
Hi Brian, yup that looks correct - the UI structure in v3 is slightly different and icon is no longer assigned by style but by an icon="" attribute like you show there.

In v2 the entire button control was drawn with some code in the C++ back end but in v3 the button is drawn using all HTML with the icon being an <img> tag.

V3 uses a template mechanism to expand a single control tag out into a chunk of structured HTML, the template for a control is in a file name of the same name of the control in the \ui sub-folder. Like for example <moi:CommandButton> uses the template file CommandButton.htm to generate its internal HTML structure.

- 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
Next
 From:  Alomphega
1029.29 
Hello,

I am a bit confused with this Construction line script installation/utilization.

First I have tried the Petr's MoI page "ConstructionLine" scripts as shortcuts and all was fine.

So happy I was ! :-)

Then I have erased the 3 shortcuts created on Petr's indications and I have installed the Michael's ConstructionLine3 script found in this discussion.
After installation as explained in the readme.txt file and benfarmer's recommended modifications for the Beta3
and after the re-start of MoI I do not see anything like icons or something else to use the construction lines script...

Where am I wrong ?
Since I do not find anything to use MoI scripts, is anywhere a manual to understand how to well install and use MoI scripts ? (say not to program them, just on a boeotian-new user point of view...)

Thanks for your time,
Guy

_____________________________________________________________________________________
always working on few funny projects : www.nauticaerium.com ; www.conceptarum.com and so on...

  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
Next
 From:  Michael Gibson
1029.30 In reply to 1029.29 
Hi Guy, some of the information about modifying the UI to add buttons to it is old now and only applies to MoI version 2 and not version 3 anymore.

So you should avoid doing some parts of the instructions - skip anything that talks about adding buttons or modifying files inside the \ui subfolder, that adds a lot of complexity to getting things set up so I would not recommend trying to do that part right now unless you are familiar with editing HTML.

Instead of trying to add a button the more usual way of calling a plug-in for now is to set up a shortcut key for the plug-in and run it by pushing whatever key you assign to the shortcut.

In the future I do want to make it easier to set up some UI for plug-ins, something like a special plug-in menu or something like that.

- 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
Next
 From:  Alomphega
1029.31 In reply to 1029.30 
Hi Michael,

> So you should avoid doing some parts of the instructions [...] unless you are familiar with editing HTML.

Well, in fact I am a bit familiar with editing and text-editing the HTML code and I can do that without hurt the code, but of course I prefer to avoid it if I can, especially when I do not know the logical inside.

> Instead of trying to add a button the more usual way of calling a plug-in for now is to set up a shortcut key for the plug-in and run it by pushing whatever key you assign to the shortcut.

By "calling a plug-in" and "to set up a shortcut key for the plug-in" do you mean than, for instance with your "ConstructionLin3.zip" script, we just have to put both the .htm and .js in the MoI "./commands" directory and then "ConstructionLine.js" and "ConstructionLine.htm" are seen like plug-in by MoI and can just to be called by their root name - as "ConstructionLine" - just written as this in the "Command" section of one new shortcut created in the Shortcuts key section of the options ?

Or do we have to do anything else ?

In fact of course I have tried what I supposed above, and I found that if I choose "L" as shortcut key for instance, when I press "L" a panel "Drag to create construction lines" appears with "clear", "done" and "cancel" buttons which are quite simple to understand, but maybe I have missed something ?

> In the future I do want to make it easier to set up some UI for plug-ins, something like a special plug-in menu or something like that.

Sure it will be very easier, but for now it miss just a written method to deal with that because I have searched and found nothing nowhere... Maybe there is something but sure it is too hard to find for me.

So I suggest you to put something like that after "Scripting" title on the "Resources" page of the MoI website just to avoid many questions :
--8<--
To install a "ScriptName" script just unzip the zipped script "ScriptName.htm" and "ScriptName.js" files, put them in the "commands" directory of the MoI installation the re-start MoI.
To run this "ScriptName" script create a new shortcut with a new key of your choice in MoI options with "ScriptName" written in the "Command" line. Using this shortcut will run the script.
--8<--

Please if I am wrong tell me what I have missed !

Cordially,
Guy

_____________________________________________________________________________________
always working on few funny projects : www.nauticaerium.com ; www.conceptarum.com and so on...

  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
Next
 From:  Michael Gibson
1029.32 In reply to 1029.31 
Hi Guy,

quote:
By "calling a plug-in" and "to set up a shortcut key for the plug-in" do you mean than, for instance with your "ConstructionLin3.zip" script, we just have to put both the .htm and .js in the MoI "./commands" directory and then "ConstructionLine.js" and "ConstructionLine.htm" are seen like plug-in by MoI and can just to be called by their root name - as "ConstructionLine" - just written as this in the "Command" section of one new shortcut created in the Shortcuts key section of the options ?
Yup, that's correct!

quote:
Or do we have to do anything else ?
Nope!

quote:
In fact of course I have tried what I supposed above, and I found that if I choose "L" as shortcut key for instance, when I press "L" a panel "Drag to create construction lines" appears with "clear", "done" and "cancel" buttons which are quite simple to understand, but maybe I have missed something ?
Nope, you haven't missed anything - when you see that it means you have successfully installed and then launched the plug-in, so you're all up and running and all set.


quote:
So I suggest you to put something like that after "Scripting" title on the "Resources" page of the MoI website just to avoid many questions :
Usually I include those instructions in every forum post where I am introducing a new plug-in. Every once in a while when I'm talking to someone who has already done it a bunch before I may forget to include the instructions, sorry about that!

I definitely want to improve the entire plug-in system to make it easier to browse a central repository of plugins and just push a button or something to install one and also have some list of them displayed in the UI.

- 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
Next
 From:  Alomphega
1029.33 In reply to 1029.32 
Ok, thanks Michael :-)

BTW :
could you give us a short explanations on how to use this ConstructionLine script v3 ?
Is it the last (best) version of your Construction Line script ?
Is this version do all what the previous did ?

Cordially,
Guy

_____________________________________________________________________________________
always working on few funny projects : www.nauticaerium.com ; www.conceptarum.com and so on...

  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:  1-13  14-33  34-48