Starting from QCAD pro dxf files with extra xData I've started building a 3D BIM modeler.
https://www.youtube.com/watch?v=pDnM-um ... a7p4AaABAg
To handle the 2D to 3D conversion from blocks to windows, doors or other complex geometry, I was thinking to introduce a "flip" parameter.
My question here is - is there any interactiv function in QCAD pro that can help me do this?
Static is not a problem.
Flip parameter
Moderator: andrew
Forum rules
Always indicate your operating system and QCAD version.
Attach drawing files and screenshots.
Post one question per topic.
Always indicate your operating system and QCAD version.
Attach drawing files and screenshots.
Post one question per topic.
-
CVH
- Premier Member
- Posts: 4957
- Joined: Wed Sep 27, 2017 4:17 pm
Re: Flip parameter
Hi,
Blocks or Block definitions have no 'Flip' property.
A Block listed in the Block List is not a standalone drawing entity, it is rather a named container for grouping drawing entities.
A Block Reference is itself a drawing entity that displays a virtual copy of the Block content at a position, in a certain scale, rotation and so on.
Flipping a Block Reference can be nothing more than a negative scale in X and/or Y.
In fact, it is displayed mirrored in regards with the X and/or Y axis of the Block definition.
But flipping may also be in regards with the center of the bounding box.
For a selected Block Reference or any selection of entities: Modify .. Flip Horizontal (FH) or Vertical (FV).
Expect a rotation change when flipping a Block Reference.
FH and FV could be simplified to a negative scale when the Block origin is centered.
scripts/Modify/FlipHorizontal/FlipHorizontal.js and scripts/Modify/FlipVertical/FlipVertical.js
Of those scripts the beginEvent must be triggered with an existing selection.
By default one is editing the Model_Space Block.
For flipping all the content of a Block definition you need to edit the intended Block and Select All (TA).
Selected or not is a volatile entity status when QCAD is running and not a drawing entity status saved to DXF.
Perhaps this all can be achieved with a set of dedicated ECMAScript's that make the bridge between a Phyton call and the QCAD API.
Similar as calling the QCAD Revert method combined with reading command line arguments.
On the other hand ...
Figuring out a bounding box and/or mirroring an entity in regards with an axis is far less complex than what you achieved already.
Impressing stuff
Regards,
CVH
Blocks or Block definitions have no 'Flip' property.
A Block listed in the Block List is not a standalone drawing entity, it is rather a named container for grouping drawing entities.
A Block Reference is itself a drawing entity that displays a virtual copy of the Block content at a position, in a certain scale, rotation and so on.
Flipping a Block Reference can be nothing more than a negative scale in X and/or Y.
In fact, it is displayed mirrored in regards with the X and/or Y axis of the Block definition.
But flipping may also be in regards with the center of the bounding box.
For a selected Block Reference or any selection of entities: Modify .. Flip Horizontal (FH) or Vertical (FV).
Expect a rotation change when flipping a Block Reference.
FH and FV could be simplified to a negative scale when the Block origin is centered.
scripts/Modify/FlipHorizontal/FlipHorizontal.js and scripts/Modify/FlipVertical/FlipVertical.js
Of those scripts the beginEvent must be triggered with an existing selection.
By default one is editing the Model_Space Block.
For flipping all the content of a Block definition you need to edit the intended Block and Select All (TA).
Selected or not is a volatile entity status when QCAD is running and not a drawing entity status saved to DXF.
Perhaps this all can be achieved with a set of dedicated ECMAScript's that make the bridge between a Phyton call and the QCAD API.
Similar as calling the QCAD Revert method combined with reading command line arguments.
On the other hand ...
Figuring out a bounding box and/or mirroring an entity in regards with an axis is far less complex than what you achieved already.
Impressing stuff
Regards,
CVH
-
ionut
- Junior Member
- Posts: 10
- Joined: Mon Dec 09, 2024 10:58 am
Re: Flip parameter
Interesting - the negative scale x/y works perfect for me!
Thank you!
I am working now on a demo video for a 11 storey/ 44 apartments demo - from qcad draft to 3D glb and IFC model.
There are still some functions that will make this app verry user friendly for QCAD pro users - but I will come back with questions.
I don't want to do reinvent the wheel if there are already functions that work in QCAD done by smarter people than me!
Thank you again!
Thank you!
I am working now on a demo video for a 11 storey/ 44 apartments demo - from qcad draft to 3D glb and IFC model.
There are still some functions that will make this app verry user friendly for QCAD pro users - but I will come back with questions.
I don't want to do reinvent the wheel if there are already functions that work in QCAD done by smarter people than me!
Thank you again!