Show messages:
1-20
…
101-120
121-140
141-160
161-180
181-188
From: Michael Gibson
Hi Booleano,
re:
> And it would look like the attached image (can I do any icon design instead of the "?" Signs).
Yes, you can make your own icon image saved as a .png file, copy the file over into the ui\icons folder,
and have them referenced as the other buttons do as an icon="" attribute on the command button tag.
re:
> What code should I use, and in what type of file to write it.
For direct script code like that, you can put it contained inside of a function in a <script> tag inside the <head>
of your document, and have the script function called in an onclick="" handler on the command button tag.
So inside the <head> of your document, you would put:
code:
<script>
function DoCreateStyles()
{
/* Create a style for each object name */ var AllObjects = moi.geometryDatabase.getObjects (); ... rest of script code here ....
}
And on your command button tag put:
code:
<moi:CommandButton onclick="DoCreateStyles();">,,,
- Michael
From: Booleano
Hi
Thanks again for your help.
The ideal thing for me would be that you attach the documents for a script.
I don't know if there would be 2 files, for example the name would be "Styles"
1 - "Styles.htm"
And this
And on your command button tag put:
code:
<moi:CommandButton onclick="DoCreateStyles();">,,,
I don't know how it would be
I am attaching a file of what I think I understood.
Please, if it's wrong, you can modify it and resubmit it to serve as a template for the other scripts.
If the second file is missing, please can you send it to me.
From: Michael Gibson
Hi Booleano, if you attach the .htm file for your dialog instead of only a screenshot then I can make you a demonstration in your actual UI file.
- Michael
From: Booleano
Hi Michael.
If that's what I want, please, why don't I know how to do it.
I don't know Java and its syntax.
I thought that Google had translated it well, but it seems that it is not like that.
Sorry, and thank you very much again.
From: Michael Gibson
Hi Booleano, I'm sorry I don't understand.
Is it correct that you are working on a dialog box that has command buttons in it?
If so can you please post the .htm file for your dialog here?
- Michael
From: Booleano
Hi Michael
I apologize for not being able to express what I really need.
I attach 2 files that are:
"Script.txt" where the scripts that each icon in the attached image "Styles.jpg" and its corresponding code are indicated (it is written as it would be added as a keyboard shortcut).
"SidePane1.htm" is the current file of the pop-up window of the image "Styles.jpg", where the 3 icons of the file "Script.txt" are already added
I hope this time you understand what I want to do.
And the file "SidePane1.htm" that I need you to modify, I suppose it will help me to know how to add possible useful scripts for me.
And I thank you again for your invaluable help.
From: Michael Gibson
Hi Booleano, so for the icons you need to make each icon image into its own separate file. Usually the icons are 64 width 64 height PNG image files.
Then copy your 3 new icon image files into the "icons" sub-folder inside the ui folder. Then you'll be able to use them in a command button.
For running those scripts, step #1 is to modify your SidePane1.htm file to add a <head> section, usually <style> and <script> go in the <head> section of an html file.
So that would look like this:
code:
<html>
<head>
<style>
/* Turn off text block under command button icon */
moi\:CommandButton > div {
display:none;
}
/* Cambio de tamaño de los iconos */
moi\:CommandButton > img, moi\:CommandMenuButton > img, moi\:CommandSplitButton > img {
width:8em;
height:8em;
}
</style>
</head>
<body class="SidePaneBody">
....
Now add a <script> section inside the <head> after the <style>:
code:
<html>
<head>
<style>
/* Turn off text block under command button icon */
moi\:CommandButton > div {
display:none;
}
/* Cambio de tamaño de los iconos */
moi\:CommandButton > img, moi\:CommandMenuButton > img, moi\:CommandSplitButton > img {
width:8em;
height:8em;
}
</style>
<script>
</script>
</head>
Then inside the <script></script> section you can add functions that contain script code:
code:
<script>
function ScriptCodeFunction1()
{
}
</script>
copy the script code from your Scripts.txt inside the function, in between { }.
To make a command button call the script function, put in an onclick="" attribute in the moi:CommandButton element, like this:
<moi:CommandButton icon="icons/icon_filename.png" onclick="ScriptCodeFunction1()">Text here</moi:CommandButton>
You can remove the command="" attribute from these particular 3 buttons, they will be calling script code inside this same file instead of running a command.
Let me know if you're still stuck.
- Michael
From: Booleano
Hi Michael.
Understood everything perfectly.
My pop-up window is only going to have little-used scripts, it is very overwhelming to remember 20-40 keyboard shortcuts, at least for me, that's why I needed this.
So once again thank you very much.
You can tell me where I can check the syntax of the version in which the MOI scripts are written.
For many years now, I was programming in C ++, Borland's version for MS-DOS (Windoss did not yet exist), and it would be useful for me to at least know how to modify some script, without going crazy.
If I need to add more sripts they will all be in a red box, to know that they are not tools.
Image Attachments:
MOI_V_2.JPG
From: Michael Gibson
Hi Booleano,
re:
> You can tell me where I can check the syntax of the version in which the MOI scripts are written.
There isn't really a place currently where that can be checked other than by running it in MoI.
In the future i would like to work on a built in script editor that would help make it easier to write and debug scripts. It wiill take a lot of effort to make it though.
- Michael
From: Booleano
Hi Michael.
I really think that I would only need the necessary Java version, and I would search the Internet for the information I need.
I will never write a script, only on occasion would I modify an existing one.
Thanks.
From: Michael Gibson
Hi Booleano, the script language version that MoI uses is called JavaScript and the specific version name is called ECMAScript v5 .
- Michael
From: Booleano
Hi Michael.
Thank you
From: Mindset (IGNITER)
Don't understand what gives here:
MindSet
Image Attachments:
Screenshot 2021-06-04 005006.png
From: Frenchy Pilou (PILOU)
As you can edit Dimension Text anything can be writed!
or can be also an perspective effect!
etc...
From: Mindset (IGNITER)
So, it really doesn't offer measurements as fractions?
Hmm, maybe that makes sense; thought I was doing something wrong... both examples are coplanar.
Thanks!
From: Michael Gibson
Hi Mindset,
> Don't understand what gives here:
Dimension values are rounded using the setting under Formatting > "Decimal display" for decimals and Formatting > "Fractional display" for feet & inches.
So if you want to display a fraction less than that you'll need to set the display precision to be tighter. You can set the default used for new dims under Options > Dimensions, and you can set the properties for existing ones by selecting it and pushing "Details...".
If you're still having a problem can you please post the .3dm model file with your dim in it so I can take a look.
- Michael
From: neilwilson3412
im loving it!!!! performance is great and so stable!
From: Michael Gibson
Ok, I finally got back to tuning up the web site a little more and there is now a "what's new" page for V4 here:
http://moi3d.com/4.0/whatsnew.htm
- Michael
From: Frenchy Pilou (PILOU)
Super!
From: LarryV
Hello Michael, everyone, I'd like to ask whether there are incremental updates to V4 since its initial non-beta release. The reason why I'm asking is because I upgraded to V4 pretty early on and I was wondering if there have been any minor version updates released since which I may be missing.
Thank you!
Show messages:
1-20
…
101-120
121-140
141-160
161-180
181-188