ExtrudedAreaSolid3D [Résolu]


Ich habe mit folgendem Code eine Extrusion erstellt.

    
    pol = AllplanGeo.Polygon3D()
    pol += AllplanGeo.Point3D(0, 0, 0)
    pol += AllplanGeo.Point3D(1, 0, 0)
    pol += AllplanGeo.Point3D(1, 1, 0)
    pol += AllplanGeo.Point3D(0, 0, 0)
    area = AllplanGeo.PolygonalArea3D()
    area += pol
    solid = AllplanGeo.ExtrudedAreaSolid3D()
    solid.SetDirection(AllplanGeo.Vector3D(1, 1, 1))
    solid.SetRefPoint(AllplanGeo.Point3D(5, 5, 5))
    solid.SetExtrudedArea(area)
    print(pol)
    print(type(pol))
    print(area)
    print(type(area))
    print(solid)
    print(type(solid))
    #model_ele_list.append(AllplanElements.ModelElement3D(com_prop, pol))
    #model_ele_list.append(AllplanElements.ModelElement3D(com_prop, area))
    model_ele_list.append(AllplanElements.ModelElement3D(com_prop, solid))

Der erstellte Solid ist valid, IsValid() gibt true zurück, aber weder der solid noch das area erscheinen am Bildschirm. Keine Fehlermeldung nichts. Das polygon pol erscheint als 3D-Fläche am Bildschirm. Kann es sein, dass ModelElement3D nicht alle Elemente akzeptiert?!

gruss bernd

BIM, BAM, BOOM
BIM-Modelle Tragwerksplaner --> http://www.bimstatik.ch/
My Allplan PythonParts --> https://github.com/BIMStatik/AllplanPythonParts
LinkedIN --> https://ch.linkedin.com/in/bernd-hahnebach-269b855a

Show solution Hide solution

Hallo Bernd,

der ExtrudedAreaSolid ist nur ein Container für die Erzeugungsparameter.
Daraus wird erst ein "darstellbarer Körper" (BRep oder Polyhedron), indem man mit

err , phd = CreatePolyhedron(solid)

einen Polyeder erzeugt, und dann mit:

if err==Geo.eGeometryErrorCode.eOK:
model_ele_list.append(AllplanElements.ModelElement3D(com_prop, phd))

daraus ein ModelElement.

Selbiges gilt für:
ClippedSweptSolid3D
Cylinder3D
Polyline3D
Polygon2D
Polygon3D

Dank der fehlenden Typprüfung in Python (Ducktyping) kann man leider immer alles
mögliche in solch eine Funktion "reinreichen"...

Gruß Jörg

11 - 14 (14)

Ahh, mit den closegaps braucht es noch mehr parameter ...

    err, brep = Geo.CreateSweptBRep3D(profiles, extrudepath, closegaps, railrotation, axis)  # 2017

gibt zwar keinen Fehler, aber der BRep ist leer ...

Script =  BIMStatik\minipart3D
BRep3D(
   RefPoint(0, 0, 0)
   PartsCount(0)
   EdgeCount(0)
   FaceCount(0)
   VertexCount(0)
   Vertices())

gruss bernd, der weiter in der API stöberd ...

BIM, BAM, BOOM
BIM-Modelle Tragwerksplaner --> http://www.bimstatik.ch/
My Allplan PythonParts --> https://github.com/BIMStatik/AllplanPythonParts
LinkedIN --> https://ch.linkedin.com/in/bernd-hahnebach-269b855a

Cité par Nemo
was heisst: "Mhh, Fehler ..."
Mein Fehler?
Das versuche ich gerade herauszufinden ... eventuell hasst Du den post vor einfügen meines trace output gelesen ... Allplan ist abgeschmiert und der Browser gleich mit ... Darum kam der Trace output erst später ...

BIM, BAM, BOOM
BIM-Modelle Tragwerksplaner --> http://www.bimstatik.ch/
My Allplan PythonParts --> https://github.com/BIMStatik/AllplanPythonParts
LinkedIN --> https://ch.linkedin.com/in/bernd-hahnebach-269b855a

heilloses durcheinander hier, OK nun nochmal geordnet. Folgendes gibt keinen Fehler, aber einen leeren BRep:

    err, brep = Geo.CreateSweptBRep3D(profiles, extrudepath, railrotation, axis)  # 2017

Trace output:

Script =  BIMStatik\minipart3D
BRep3D(
   RefPoint(0, 0, 0)
   PartsCount(0)
   EdgeCount(0)
   FaceCount(0)
   VertexCount(0)
   Vertices())

BIM, BAM, BOOM
BIM-Modelle Tragwerksplaner --> http://www.bimstatik.ch/
My Allplan PythonParts --> https://github.com/BIMStatik/AllplanPythonParts
LinkedIN --> https://ch.linkedin.com/in/bernd-hahnebach-269b855a

Hallo Jörg,

Habs gefunden ...

Die anzahl der control profiles braucht es noch. Was immer die auch angeben, mit einem funktioniert es bei mir.

    err, brep = Geo.CreateSweptBRep3D(profiles, extrudepath, closegaps, railrotation, axis, 1)  # 2017

vielen Dank für die Unterstützung

Gruss Bernd

BIM, BAM, BOOM
BIM-Modelle Tragwerksplaner --> http://www.bimstatik.ch/
My Allplan PythonParts --> https://github.com/BIMStatik/AllplanPythonParts
LinkedIN --> https://ch.linkedin.com/in/bernd-hahnebach-269b855a

11 - 14 (14)

https://campus.allplan.com/ utilise des cookies  -  Plus d'informations

Accepter