Skip to content

Component says 0 bodies after copying a body into it #2102

Open
@RyanJWard

Description

@RyanJWard

🔍 Before submitting the issue

  • I have searched among the existing issues
  • I am using a Python virtual environment

🐞 Description of the bug

depending on how we copy a body into a component we get a different result for the number of bodies in the component

📝 Steps to reproduce

modeler = Modeler(host="127.0.0.1", port=50051, timeout=10)

file = "C:\Users\rward\Downloads\bottom_mounted_imp (1).dsco"

design1 = modeler.create_design('Test')

comp1 = design1.add_component('test')

design1.insert_file(file)
#copy_test = design1.components[1].bodies[0].copy(design1.components[0],'test')
copy_test = design1.components[1].bodies[0].copy(comp1,'test')
for i, component in enumerate(design1.components):
print(f"Component {i}: {component}")

Component 0: ansys.geometry.core.designer.Component 0x1e57727ba10
Name : test
Exists : True
Parent component : Test
N Bodies : 0
N Beams : 0
N Coordinate Systems : 0
N Design Points : 0
N Components : 0

If we use the commented out version: copy_test = design1.components[1].bodies[0].copy(design1.components[0],'test')
Component 0: ansys.geometry.core.designer.Component 0x1e5649d77d0
Name : test
Exists : True
Parent component : Test
N Bodies : 1
N Beams : 0
N Coordinate Systems : 0
N Design Points : 0
N Components : 0

💻 Which operating system are you using?

Windows

📀 Which ANSYS version are you using?

261

🐍 Which Python version are you using?

3.12

📦 Installed packages

import os
import sys
import math
from pathlib import Path
from pyvista.plotting import system_supports_plotting
from ansys.geometry.core import *
from ansys.geometry.core.connection import *
from ansys.geometry.core.designer import *
from ansys.geometry.core.materials import *
from ansys.geometry.core.math import *
from ansys.geometry.core.misc import *
from ansys.geometry.core.misc.units import *
from ansys.geometry.core.plotting import *
from ansys.geometry.core.sketch import *
from ansys.geometry.core.designer import body
from ansys.geometry.core.misc import UNITS, Distance
from ansys.geometry.core.shapes.curves.line import Line

import numpy as np
import random

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions