Matlab controlling ANSYS Designer

Status
Not open for further replies.

kato

Junior Member level 3
Joined
Jun 25, 2007
Messages
26
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,281
Activity points
1,487
Hello,

I am trying to control ANSYS' Designer with Matlab

The following is a working command which draws a polygon:

invoke(oEditor,'CreatePolygon', {'NAME:Contents', 'polyGeometry:=', {'Name:=','Dipole_Top_Arm','LayerName:=','Dipole_Trace','lw:=','0mm','n:=',5,'U:=','mm', 'x:=',0.5,'y:=',1,'x:=',2,'y:=',1,'x:=',5,'y:=',10,'x:=',-5,'y:=',10,'x:=',-2,'y:=',1,'x:=',0.5, 'y:=',1}}); (1)

As one can see, the command has a section which defines the number of points <<'n:=',5>> and another section that defines the coordinates of the points

<<'x:=',0.5,'y:=',1,'x:=',2,'y:=',1,'x:=',5,'y:=',10,'x:=',-5,'y:=',10,'x:=',-2,'y:=',1,'x:=',0.5, 'y:=',1}>> (2)

Since the number of points is a variable, I need to be able to define a number of coordinate sets, which I could define as an array, something like

A(1)='x:=',0.5,'y:=',1
A(2)='x:=',2,'y:=',1 … etc

and then rather than writing the series above (2), just A, like

invoke(oEditor,'CreatePolygon', {'NAME:Contents', 'polyGeometry:=', {'Name:=','Dipole_Top_Arm','LayerName:=','Dipole_Trace','lw:=','0mm','n:=',5,'U:=','mm', A}})


All my attemps failed. One of them is

A{1}=strcat(q,'x:=',q,num2str(0.5),v,q,'y:=',q,num2str(1),q,v); where

q=char(39) <<'>>
v=char(44) <<,>>

Any ideas?
 

I haven't used Designer before, But I used to use script to control HFSS. I guess they are similar. So I suggest you can use the script record function to generate the script by Designer itself. Then you can edit this auto-generated script according to your requirements
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…