Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

What does this activeX error mean, how do i fix it?

Asked by Daleel Lilla

Daleel Lilla (view profile)

on 8 Aug 2012

Hi, Im attempting to use a finite element analysis program (infolytica Magnet), in conjunction with MAtlab R2011a by using activeX. I dont have much experience with activeX, however, i have found some code from the software distributor (Infolytica), which should allow both programs to communicate with each other. This code should open up the FEA software, and draw a line. code:

   MN6 = actxserver ('Magnet.Application');
   MN6.Visible = 'true';
   % set MagNet constants
   Consts = invoke(MN6, 'getConstants');
   % open new document
   dev = invoke(MN6, 'newDocument');
   % draw a line on the screen
   invoke(dev, 'newConstructionSliceLine', 3, 0, 5, 2)

error which i receive:

   ??? No public field Visible exists for class COM.Magnet_Application.
   Error in ==> Matlab_server at 2
   MN6.Visible = 'true';

Im not sure why this error is coming up. Any help, would be greatly appreciated.

regards, Daleel

0 Comments

Daleel Lilla

Daleel Lilla (view profile)

Tags

Products

2 Answers

Answer by per isakson

per isakson (view profile)

on 8 Aug 2012

Try

    methods( MN6 )
    MN6.Visible = true;

4 Comments

per isakson

per isakson (view profile)

on 9 Aug 2012

I should have proposed

    properties( MN6 )

Is it case sensitive? Try

    MN6.visible = 'true'

The value should it be char not logical?

Guillermo

Guillermo (view profile)

on 29 Oct 2012

please try set(mn6, 'Visible', 1) instead mn6.Visible = true;

regards,

guillo

Image Analyst

Image Analyst (view profile)

on 26 Nov 2012

No, you didn't try it. You continued to do

MN6.Visible = 'true';

while per said to do this:

MN6.Visible = true;

You're setting it to a string and he said to set it to a boolean. And your list shows methods, not properties. Try to get the properties to see if visible is one of them - it most likely is.

per isakson

per isakson (view profile)

Answer by Brian Keats

Brian Keats (view profile)

on 26 Nov 2012

mn6.set('visible','true')

0 Comments

Brian Keats

Brian Keats (view profile)

Contact us