kato
Junior Member level 3
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 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?