Mailing List
Home
Forum Home
Softimage
Carrara
trueSpace
Dir3d-l
Maya - a powerful 3D animation and visual effects software
Macromedia Flash Development
Subjects
Cameras
scaleDown command
black out solved
Aircraft Tutorial
Mathematical XYZ ?
Its done This vs That
Its done first week
recommendations for screen video captures?
3DExplorer "Oddity "
New Director
ProTeam renewals
Fuel 's new websites (X post)
Blue peter create a make toy
targeting groups question
XPost: Shockwave 3D game ( sort of )
RES: RES: RES: Fish Modeling
Emitting particles from object intersection
Fuel 's new websites (X post)
Texturing
Big Break Contest Videos
New Plugins
Models and Texture on my updated site
Error Installing Patch tS6 6
Plasma?
Looking for Inspiration
Weird EMail Q
It 's done first week ?
Cherry not cranberry
New game
Camera Animation Problem
Particle plugins?
 
dotNet

dotNet

2005-04-06       - By Brad Friedman

 Back
Reply:     1     2     3     4     5     6     7     8  

Brad Friedman wrote:

>
> I'm going to try giving this stuff a run in the next few days.  If I
> get a LogMessage("HelloXSIWorld") functioning from c# I'm sure you'll
> hear from me :)
>
You are now hearing from me :)

It works.

In otherwords... I got the following .cs file to work.

[code]
/*
* Created by SharpDevelop.
* User: leith
* Date: 4/6/2005
* Time: 8:55 AM
*
* To change this template use Tools | Options | Coding | Edit Standard
Headers.
*/


using System;
using System.Runtime.InteropServices;
using XSI = SI3DOBJECTMODELLIB;
namespace XSIHelloWorld
{

   public interface IXSIHelloWorld{
     
       void callMe();
     
   }

   [ClassInterface(ClassInterfaceType.AutoDual)]
   public class XSIHelloWorld : IXSIHelloWorld{
     
       public void callMe(){
           XSI.CXSIApplicationClass app = new XSI.CXSIApplicationClass();
           ((XSI.Application) app).LogMessage("HELLO XSI WORLD!",
XSI.siSeverity.siInfo);
         
       }
     
   }
}
[/code]

The important thing here is that the c# code is calling into the XSI COM
type libraries directly and is being called through scripting.

So umm... yea.  Wow.  AWESOME!  WOO HOO!  HOORAY!

I'm going to spend some time over the next few days trying to streamline
this execution environment to make it easy to install and all that
jazz.  Then I'll publish it to make it accessible.

BTW, I have run into one slightly annoying problem.  Once you create the
activex object, XSI holds onto it and makes recompiling the DLL
impossible until you close XSI.  What would be the best way to force the
activex object to be destroyed and get the DLL unloaded?  So I can keep
from having to reload XSI every time I want to compile?  Or is this
impossible?  Any thoughts?

-brad

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
 <meta content="text/html;charset=ISO-8859 (See http://ISO-8859.ora-code.com)-1" http-equiv="Content-Type">
 <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Brad Friedman wrote:
<blockquote cite="mid42531100.5080804@(protected)" type="cite">
 <meta content="text/html;charset=ISO-8859 (See http://ISO-8859.ora-code.com)-1" http-equiv="Content-Type">
 <title></title>
 <span class="MsgViewAlternateBody"><br>
I'm going to try giving this stuff a run in the next few days.&nbsp; If I
get a LogMessage("HelloXSIWorld") functioning from c# I'm sure you'll
hear from me :)<br>
 <br>
 </span></blockquote>
You are now hearing from me :)<br>
<br>
It works.<br>
<br>
In otherwords... I got the following .cs file to work.<br>
<br>
[code]<br>
/*<br>
&nbsp;* Created by SharpDevelop.<br>
&nbsp;* User: leith<br>
&nbsp;* Date: 4/6/2005<br>
&nbsp;* Time: 8:55 AM<br>
&nbsp;* <br>
&nbsp;* To change this template use Tools | Options | Coding | Edit Standard
Headers.<br>
&nbsp;*/<br>
<br>
<br>
using System;<br>
using System.Runtime.InteropServices;<br>
using XSI = SI3DOBJECTMODELLIB;<br>
namespace XSIHelloWorld<br>
{<br>
<br>
&nbsp;&nbsp;&nbsp; public interface IXSIHelloWorld{<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; void callMe();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; }<br>
<br>
&nbsp;&nbsp;&nbsp; [ClassInterface(ClassInterfaceType.AutoDual)]<br>
&nbsp;&nbsp;&nbsp; public class XSIHelloWorld : IXSIHelloWorld{<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; public void callMe(){<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; XSI
.CXSIApplicationClass app = new
XSI.CXSIApplicationClass();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ((XSI.Application) app
).LogMessage("HELLO XSI WORLD!",
XSI.siSeverity.siInfo);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; }<br>
}<br>
[/code]<br>
<br>
The important thing here is that the c# code is calling into the XSI
COM type libraries directly and is being called through scripting.<br>
<br>
So umm... yea.&nbsp; Wow.&nbsp; AWESOME!&nbsp; WOO HOO!&nbsp; HOORAY!<br>
<br>
I'm going to spend some time over the next few days trying to
streamline this execution environment to make it easy to install and
all that jazz.&nbsp; Then I'll publish it to make it accessible.<br>
<br>
BTW, I have run into one slightly annoying problem.&nbsp; Once you create
the activex object, XSI holds onto it and makes recompiling the DLL
impossible until you close XSI.&nbsp; What would be the best way to force
the activex object to be destroyed and get the DLL unloaded?&nbsp; So I can
keep from having to reload XSI every time I want to compile?&nbsp; Or is
this impossible?&nbsp; Any thoughts?<br>
<br>
-brad<br>
</body>
</html>