Community
Forma Developer Forum
Welcome to Autodesk Forma Developer Forum. Share your knowledge, ask questions, and explore popular Forma API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Create 2.5D building with floor polygons

0 REPLIES 0
Reply
Message 1 of 1
zhukoven
51 Views, 0 Replies

Create 2.5D building with floor polygons

Hi Forma team!

 

Could you please guide me on how to correctly create a Forma building element with multiple polygons, representing CORECORRIDOR, and LIVING_UNITs via embedded view sdk?

 

I see that SDK allows for multiple ways to create elements. Maybe there is the right one that I'm missing?

 

[edit]: it's easy to create basic 2.5d building with a floorStack, but does it allow to nest multiple polygons and unit types?

    const floors = Array.from({ length: numFloors }, (_, index) => ({
        polygon: [
            [0, 0], 
            [floorLength, 0], 
            [floorLength, floorWidth], 
            [0, floorWidth], 
            [0, 0]
        ],
        height: floorHeight,
    }));

    const { urn } = await Forma.elements.floorStack.createFromFloors({
        floors: floors,
    })

    const transform = [
        1, 0, 0, 0, 
        0, 1, 0, 0, 
        0, 0, 1, 0, 
        centerX, centerY, minZ, 1,
    ]
    await Forma.proposal.addElement({ urn, transform });

 

0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report