CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Mesh Generation & Pre-Processing Software > ANSA

Script_part instance

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By rmaries

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 14, 2018, 22:33
Post Script_part instance
  #1
New Member
 
Viswanathan
Join Date: Jul 2018
Posts: 9
Rep Power: 7
Viswa is on a distinguished road
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?
Viswa is offline   Reply With Quote

Old   July 16, 2018, 03:00
Default
  #2
Member
 
Maries
Join Date: Mar 2010
Location: Cologne, Germany
Posts: 75
Rep Power: 16
rmaries is on a distinguished road
Quote:
Originally Posted by Viswa View Post
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?
Hi Viswanathan,

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)
MRAJALIN and Mrt23 like this.
rmaries is offline   Reply With Quote

Old   July 16, 2018, 05:28
Default
  #3
New Member
 
Viswanathan
Join Date: Jul 2018
Posts: 9
Rep Power: 7
Viswa is on a distinguished road
hi rmaries,

i have 2 parts already. i want to link those 2.
not creating new transformation
Viswa is offline   Reply With Quote

Old   July 16, 2018, 05:40
Default
  #4
Member
 
Maries
Join Date: Mar 2010
Location: Cologne, Germany
Posts: 75
Rep Power: 16
rmaries is on a distinguished road
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.
rmaries is offline   Reply With Quote

Reply

Tags
instance, part manager, scripting


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Object reference not set to instance of an object muhammadzeeshan92 ANSYS 3 October 10, 2021 12:57
problem with launching aws instance using the cfddfc CLI AAbouali OpenFOAM 2 April 19, 2021 00:56
[ANSYS Meshing] Instance Meshing with Shared Topology hunger ANSYS Meshing & Geometry 0 May 12, 2017 05:13
terminate called after throwing an instance of 'int' b614910 SU2 10 July 27, 2014 22:16
acces limiter for instance generated by vanLeer scheme stevenvanharen OpenFOAM 0 August 31, 2011 10:13


All times are GMT -4. The time now is 04:36.