-
-
February 14, 2023 at 11:11 am
2212296
Subscriber1.How to connect two cubes into a whole (code instructions)?
2.How to perform symmetrical operations on graphics (code instructions)?
thank you all !
-
February 14, 2023 at 10:52 pm
Guilin Sun
Ansys EmployeeI am not sure what do you mean "connect". You can use script to modify their relative positions:
setnamed("cube1","x",-1e-6);setnamed("cube2","x",1e-6);
similarly for yz.
You can also add them into a structure group: https://optics.ansys.com/hc/en-us/articles/360034382434-Structure-Groups-Simulation-object
Symmetry can only be performed with boundary conditions. When the device AND the source polarization have symmetry, you can apply symmetry BCs. Using
?getnamed("FDTD","x min bc"); to get the current x min BC. you can set it:
setnamed("FDTD","x min bc","symmetric"); for symmetric BC
setnamed("FDTD","x min bc","anti-symmetric"); for antisymmetric BC
Other direction is similar.
Please refer Symmetric and anti-symmetric BCs in FDTD and MODE
Please try.
Other
-
February 15, 2023 at 1:58 am
2212296
SubscriberSorry, I may not have described it accurately.
- Connection: It is to connect individual small graphics into a whole, and then mirror the whole.
- 2, I mean to mirror the pattern. How to use code to achieve?
-
-
February 15, 2023 at 5:52 pm
Guilin Sun
Ansys EmployeeIt might be able to realize. When an object is mirrored, at least one of the coordinate (xmax,ymax and zmax) will be flipped. if so, you can rotate the object 180 deg, and shift it.
For example, rotate am object 180deg and shift -2e-6 along x.
setnamed("object_name","first axis","z");
setnamed("object_name","rotation 1", 180);
setnamed("object_name","x",-2e-6);
Below are triangles, the right one is the original, and the left one is rotated and shifted.
When you say connect, do you mean add them into a group. yes, it is also doable: addstructuregroup - Script command
There are related script. Please try. If you have question using script, please write a new post.
-
- You must be logged in to reply to this topic.

Boost Ansys Fluent Simulations with AWS
Computational Fluid Dynamics (CFD) helps engineers design products in which the flow of fluid components is a significant challenge. These different use cases often require large complex models to solve on a traditional workstation. Click here to join this event to learn how to leverage Ansys Fluids on the cloud, thanks to Ansys Gateway powered by AWS.

Earth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.

Ansys Blog
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.
- “Import optical generation” or “delta generation rate”?
- Why am I getting “process exited without calling finalize”, and how do I fix it?
- Error: addfdtd is not a valid function or a variable name
- Error on Lumerical device
- Using a license file on a new license server
- Ansys Insight: Transmission results greater than one
- Ansys Insight: Diverging Simulations
- Ansys Insight: About override mesh in FDTD: its use and settings
- Is there a Lumerical script command to output the Simulation and Memory requirements?
- Ansys Insight: Convergence issues in CHARGE
-
3648
-
2512
-
1739
-
1226
-
578
© 2023 Copyright ANSYS, Inc. All rights reserved.