Guest User

Untitled

a guest
Dec 16th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. """ Handles dimensions of AHU casing."""
  2. import FreeCAD
  3. import Draft
  4.  
  5.  
  6. def create_boundary_dimensions(obj,
  7. dis_bw_obj_and_dim=100):
  8. """ Create dimensions of length, width and height of given object."""
  9. ldimline = FreeCAD.Vector(0,
  10. obj.Shape.BoundBox.YMin - dis_bw_obj_and_dim,
  11. obj.Shape.BoundBox.ZMin)
  12. ldim = Draft.makeDimension(obj.Shape.BoundBox.getPoint(4),
  13. obj.Shape.BoundBox.getPoint(5),
  14. ldimline)
  15. wdimline = FreeCAD.Vector(obj.Shape.BoundBox.XMax + dis_bw_obj_and_dim,
  16. 0,
  17. obj.Shape.BoundBox.ZMin)
  18. wdim = Draft.makeDimension(obj.Shape.BoundBox.getPoint(5),
  19. obj.Shape.BoundBox.getPoint(6),
  20. wdimline)
  21. hdimline = FreeCAD.Vector(obj.Shape.BoundBox.XMin - dis_bw_obj_and_dim,
  22. obj.Shape.BoundBox.YMin,
  23. 0)
  24. hdim = Draft.makeDimension(obj.Shape.BoundBox.getPoint(0),
  25. obj.Shape.BoundBox.getPoint(4),
  26. hdimline)
  27. FreeCAD.ActiveDocument.recompute()
  28. return ldim, wdim, hdim
Add Comment
Please, Sign In to add comment