Wrong placement on simple copy of object inside parts in v 0.17

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Wrong placement on simple copy of object inside parts in v 0.17

Post by sgrogan »

Can you post the code on the wiki like this: https://www.freecadweb.org/wiki/Macro_FCWire_To_Volume
Then the Addon manager can use it. Great tool!
"fight the good fight"
User avatar
easyw-fc
Veteran
Posts: 3633
Joined: Thu Jul 09, 2015 9:34 am

Re: Wrong placement on simple copy of object inside parts in v 0.17

Post by easyw-fc »

I tested the Macro with the 'Main Part' of my previous 'Body-in-Part-failing.FCStd' file and still the macro fails
Cannot compute Inventor representation for the shape of Copy_of_MainPart.
Here my FC details
OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.13387 (Git)
Build type: Release
Branch: master
Hash: c5f4079252b11e3c54cd603be7d3697fa9f9d922
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: English/UnitedStates (en_US)
Thx
Maurice
mario52
Veteran
Posts: 4698
Joined: Wed May 16, 2012 2:13 pm

Re: Wrong placement on simple copy of object inside parts in v 0.17

Post by mario52 »

hi
no problem with the macro

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.13387 (Git)
Build type: Release
Branch: master
Hash: c5f4079252b11e3c54cd603be7d3697fa9f9d922
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0

but the 0.17 version create big problem with the macro working with the Placement justly cause if Part placement is not 0

Part_Placement00.gif
Part_Placement00.gif (118.98 KiB) Viewed 1265 times
mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
galou_breizh
Posts: 437
Joined: Wed Sep 15, 2010 9:38 am

Re: Wrong placement on simple copy of object inside parts in v 0.17

Post by galou_breizh »

easyw-fc wrote: Fri Mar 16, 2018 11:10 pm Cannot compute Inventor representation for the shape of Copy_of_MainPart.
This is highly probably due to the fact that Copy_of_MainPart doesn't have any shape (it may have the Shape attribute in Python but Shape.isNull() will return None). Did you check whether the tip of the body is set?
sgrogan wrote: Fri Mar 16, 2018 11:00 pm Can you post the code on the wiki like this: https://www.freecadweb.org/wiki/Macro_FCWire_To_Volume
Then the Addon manager can use it. Great tool!
Feel free to paste it there. I prefer to have a version control system. Do you know if there is the possibility to include a file in the wiki given its URL (https://raw.githubusercontent.com/FreeC ... py.FCMacro)?
mario52 wrote: Sun Mar 18, 2018 2:22 pm but the 0.17 version create big problem with the macro working with the Placement justly cause if Part placement is not 0
Mario, can you please send me the file that doesn't work. Thanks!

Gaël
mario52
Veteran
Posts: 4698
Joined: Wed May 16, 2012 2:13 pm

Re: Wrong placement on simple copy of object inside parts in v 0.17

Post by mario52 »

Hi

your macro work well

but the idea create one closed world in object Part is not good idea (see my animation)

tree object Part placement different and box in coordinate 0,0,0
the placement read of the tree box are same !!

how read the real placement on the global coordinate 0,0,0 : Box + Part ? which is the real position of box in the 3D view

for my this is bug

mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
User avatar
easyw-fc
Veteran
Posts: 3633
Joined: Thu Jul 09, 2015 9:34 am

Re: Wrong placement on simple copy of object inside parts in v 0.17

Post by easyw-fc »

mario52 wrote: Mon Mar 19, 2018 10:21 am how read the real placement on the global coordinate 0,0,0 : Box + Part ? which is the real position of box in the 3D view
Hi mario,
Part is acting as the Compound container
Part-compound.gif
Part-compound.gif (349.51 KiB) Viewed 1226 times
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Wrong placement on simple copy of object inside parts in v 0.17

Post by sgrogan »

galou_breizh wrote: Sun Mar 18, 2018 9:29 pm Feel free to paste it there. I prefer to have a version control system. Do you know if there is the possibility to include a file in the wiki given its URL (https://raw.githubusercontent.com/FreeC ... py.FCMacro)?
Not yet, I think there is a feature for Addons-manager to handle this case.
"fight the good fight"
User avatar
easyw-fc
Veteran
Posts: 3633
Joined: Thu Jul 09, 2015 9:34 am

Re: Wrong placement on simple copy of object inside parts in v 0.17

Post by easyw-fc »

@Gael,
here is a case in which the deepcopy macro is adding extra objects
deepcopy-test.FCStd
(14.35 KiB) Downloaded 31 times
The case is when there are more levels in Part structure
Thx
Maurice
mario52
Veteran
Posts: 4698
Joined: Wed May 16, 2012 2:13 pm

Re: Wrong placement on simple copy of object inside parts in v 0.17

Post by mario52 »

hi easyw-fc
post_id=222001 wrote:Mon Mar 19, 2018 11:13 am Part is acting as the Compound container
ok but more easy 0,0,0 base for all instead ..
Part_Placement01.gif
Part_Placement01.gif (892.5 KiB) Viewed 1173 times
i see How to get center of selected objects/elements for upgrade to FC 0.17.

mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
Post Reply