|
[Sponsors] | |||||
|
|
|
#1 |
|
New Member
Viswanathan
Join Date: Jul 2018
Posts: 9
Rep Power: 9 ![]() |
hello,
i saw all the questions in this forum, nice discussion. i have one doubt with part instance. manualy we can create part instance by part manager. rename parts as duplicate, and ansa will ask , merge or make instance. to make two different parts as instance, do we have any script API? |
|
|
|
|
|
|
|
|
#2 | |
|
Member
Maries
Join Date: Mar 2010
Location: Coimbatore, India
Posts: 77
Rep Power: 17 ![]() |
Quote:
Welcome to the forum. Yes there is a command to create instance from part. Here is the description from ansa help. MakeNewInstance, BETA PYTHON development Manual NAME: MakeNewInstance - Create a new instance of part or group SYNOPSIS: ansa.base.MakeNewInstance(PART, TRANSFORMATION_MATRIX) DESCRIPTION: This function creates a new instance of an existing part/group. The position of the new created instance is controlled by a 4X4 transformation matrix. Arguments PART object the part object TRANSFORMATION_MATRIX object a 4x3 list that describes the transformation matrix RETURN: The MakeNewInstance function returns a reference to the new instance or None in case of error. EXAMPLE: Code:
import ansa
from ansa import base
def main():
# the example below, creates a new symmetrical instance of a part
transf_matrix = ((1,0,0,0),
(0,-1,0,0),
(0,0,1,0),
(0,0,0,1))
master = base.GetPartFromModuleId("10")
new_inst = base.MakeNewInstance(master,transf_matrix)
|
||
|
|
|
||
|
|
|
#3 |
|
New Member
Viswanathan
Join Date: Jul 2018
Posts: 9
Rep Power: 9 ![]() |
hi rmaries,
i have 2 parts already. i want to link those 2. not creating new transformation |
|
|
|
|
|
|
|
|
#4 |
|
Member
Maries
Join Date: Mar 2010
Location: Coimbatore, India
Posts: 77
Rep Power: 17 ![]() |
Don't know the exact python command for this. But you can do this in GUI. Open part manager, right click the part you want to find MI. Then Edit Tree> Detect Instances will do the job for you
If you find how to achieve this via python or betascript, please share it here. |
|
|
|
|
|
![]() |
| Tags |
| instance, part manager, scripting |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Object reference not set to instance of an object | muhammadzeeshan92 | ANSYS | 3 | October 10, 2021 13:57 |
| problem with launching aws instance using the cfddfc CLI | AAbouali | OpenFOAM | 2 | April 19, 2021 01:56 |
| [ANSYS Meshing] Instance Meshing with Shared Topology | hunger | ANSYS Meshing & Geometry | 0 | May 12, 2017 06:13 |
| terminate called after throwing an instance of 'int' | b614910 | SU2 | 10 | July 27, 2014 23:16 |
| acces limiter for instance generated by vanLeer scheme | stevenvanharen | OpenFOAM | 0 | August 31, 2011 11:13 |