After Jon answered the first I'll try to make the rest.
You can't use functions from .ma's but you can create a separate msl from nearly the same source-code. You have to create a dls-file for all exported functions and compile a msl. There was an example at bentley's with some solid-stuff (JMDL is unable to create parasolids) wich I used to expand. In JMDL you need to declare the function as 'native' via jmdl_import, for example
/*--------------------------------------------------------------------------
------------+
* @param placeBlock The mdl function in the MDL library.
* @dwmethod 04/2001 +---------------+---------------+---------------+---------------+-----------
----+------*/
jmdl_import
(
mdl="dwsolid", name=placeBlock
)
static native int placeBlock
(
double x1,double y1,double z1, double x, double y,double z );
/*--------------------------------------------------------------------------
------------+
* @param block The java method to create a block.
* @dwmethod 04/2001 +---------------+---------------+---------------+---------------+-----------
----+------*/
public static int block
(
double x1, // => Origin
double y1, // => Origin
double z1, // => Origin
double x, // => x distance of block
double y, // => y distance of block
double z // => z distance of block
)
{
return (placeBlock (x1,y1,z1,x,y,z));
} // end block
where the first part is the import function and the second the public class method for calls from other classes. I used to cover my whole mdl-calls in a separate class making public methods from all of them. For more details see the JMDL-programmers reference, search for jmdl_import there you're right.
There are many differences between JMDL and MDL - user-attributes for instance, dialogs are always unmodal in relation to Microstation (you can have modal dialogs afterwards), speed seems not to be the same (although I use mdl for 3D solids), - and naturally - no pointers, no Elementdescriptors and so on. After building an application (not small - not large) and looking at other discussions herein - I'm not sure if I would decide to implement the same once again.
Michael
PS: If you like to exchange further details - please mail me
"Sylvain Caillet" schrieb im Newsbeitrag
Hi !
I'm starting with jmdl and i have some questions to ask to you :
- when i launch from the key-in window a "java MyClass", i must stop and restart MS-J if i want to see changes i make in the .mjava. Is ther any
any
to "unload" a .mclass in MS-J ans restart it ??
- Is there any way to call a mdl function (in a .ma file) from a .mclass class ??
- Did you notice qome significant differences of speed between MDL applications and JMDL ones (for complex tasks such as DGN scanning, mathematical operations, complex dynamics functions ...).
Thanks to all for your answers.
Regards
...