[Pregunta] [PythonParts] GetParentElement

Etiquetas:

Hi,

I place a PythonPart in a room.

I'd like to retrieve the room's name with GetParentElement (I already created the link between the 2).

I tried :

pythonpart = ElementAdapter.BaseElementAdapter.FromNOIGUID(self.modify_uuid_list[0], self.coord_input.GetInputViewDocument())
local = ElementAdapter.BaseElementAdapterParentElementService.GetParentElement(pythonpart)

but it doesn't work

What is the correct syntax ?

PS I want to get the @507@ attribute of the room as in the annotation

Best Regards

Adjuntos (3)

Type: image/jpeg
Descargado 46 veces
Size: 131,77 KiB
Type: image/jpeg
Descargado 42 veces
Size: 157,53 KiB
Type: image/jpeg
Descargado 34 veces
Size: 23,76 KiB

Show most helpful answer Hide most helpful answer

Well, Colliding is as far as I know not capable of checking the intersection between two polyhedrons. For two polyhedrons use Intersect.

You can also use Intersecting for checking Polyhedrons with BRep. I never tested it, but I guess it might be more performant, as it only checks if the two are intersecting, without actually performing the boolean operation of intersection.

11 - 14 (14)

Hi,

What if I select by script all the rooms to create for each a bounding box.

I could check with IsContaining if my object is in the room ?

Best

Hi,

I am not sure, which function to use to get the geometry of a room correctly, but it must be either GetModelGeometry or GetPureArchitectureElementGeometry(). You should get a Polyhedron3D as a result. You can then either try with IsContaining method of a bounding box, but your room will not always have a geometry of a box in the ground view. The alternative is to use the DeterminePosition class. It is capable of determining a position of a point in relation to a polyhedron (outside, inside, onElement). In this case, you have to choose a relevant point (or points) of the element you want to determine the position of (the doors).
Alternatively you can perform a subtraction: of the door is fully in the room, subtracting the room polyhedron from the door will result in a polyhedron type of tInvalid.
With the version 2023-1-5 we will publish an article in our manual about the usage of DeterminePosition and Boolean operations together with some examples in the PythonPartExamples library.

Best regards

Hi,

Thanks for these alternative proposals.

With a polyhedron there is also the Colliding function.... I will test it.

Looking forward to seeing these new examples

Best

Well, Colliding is as far as I know not capable of checking the intersection between two polyhedrons. For two polyhedrons use Intersect.

You can also use Intersecting for checking Polyhedrons with BRep. I never tested it, but I guess it might be more performant, as it only checks if the two are intersecting, without actually performing the boolean operation of intersection.

11 - 14 (14)

https://campus.allplan.com/ utiliza cookies  -  Aqui

Acéptalo