BIM: misc tool adjustments
- Level offest can now be negative - Auto wall grouping is now off by default - Shape2DView (BIM version) now sets InPlace to False - The Axis tool starts with only one axis by default - Sketches initiated with the BIM Sketch command take Draft colors - Snapping WP shortcuts were changed to avoid conflicts
This commit is contained in:
committed by
Yorik van Havre
parent
f9ceb7d35d
commit
ef08efcd00
@@ -54,7 +54,7 @@ from ArchStructure import *
|
||||
|
||||
# make functions
|
||||
|
||||
def makeAxis(num=5,size=1000,name=None):
|
||||
def makeAxis(num=1,size=1000,name=None):
|
||||
|
||||
'''makeAxis([num],[size],[name]): makes an Axis set
|
||||
based on the given number of axes and interval distances'''
|
||||
|
||||
@@ -219,7 +219,7 @@ class BuildingPart(ArchIFC.IfcProduct):
|
||||
obj.addProperty("App::PropertyBool","HeightPropagate","Children",QT_TRANSLATE_NOOP("App::Property","If true, the height value propagates to contained objects if the height of those objects is set to 0"))
|
||||
obj.HeightPropagate = True
|
||||
if not "LevelOffset" in pl:
|
||||
obj.addProperty("App::PropertyLength","LevelOffset","BuildingPart",QT_TRANSLATE_NOOP("App::Property","The level of the (0,0,0) point of this level"))
|
||||
obj.addProperty("App::PropertyDistance","LevelOffset","BuildingPart",QT_TRANSLATE_NOOP("App::Property","The level of the (0,0,0) point of this level"))
|
||||
if not "Area" in pl:
|
||||
obj.addProperty("App::PropertyArea","Area", "BuildingPart",QT_TRANSLATE_NOOP("App::Property","The computed floor area of this floor"))
|
||||
if not "Description" in pl:
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>446</width>
|
||||
<height>811</height>
|
||||
<width>519</width>
|
||||
<height>954</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -26,7 +26,7 @@
|
||||
<string>Auto-join walls</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>autoJoinWalls</cstring>
|
||||
@@ -106,10 +106,10 @@
|
||||
<item row="5" column="0" colspan="3">
|
||||
<widget class="Gui::PrefCheckBox" name="checkBox_MoveWithHost">
|
||||
<property name="toolTip">
|
||||
<string>By default, new objects will have their "Move with host" property set to False, which means they won't move when their host object is moved.</string>
|
||||
<string>By default, new objects will have their "Move with host" property set to False, which means they won't move when their host object is moved.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Set "Move with host" property to True by default</string>
|
||||
<string>Set "Move with host" property to True by default</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
@@ -125,7 +125,7 @@
|
||||
<item row="6" column="0" colspan="3">
|
||||
<widget class="Gui::PrefCheckBox" name="checkBox_MoveBase">
|
||||
<property name="text">
|
||||
<string>Set "Move base" property to True by default</string>
|
||||
<string>Set "Move base" property to True by default</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
@@ -172,6 +172,12 @@
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
@@ -330,10 +336,10 @@
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.0001</double>
|
||||
<double>0.000100000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>0.001</double>
|
||||
<double>0.001000000000000</double>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>ConversionTolerance</cstring>
|
||||
@@ -348,6 +354,12 @@
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
@@ -388,7 +400,7 @@
|
||||
<string>Specifies how many times the viewed line thickness must be applied to cut lines</string>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>2.0</double>
|
||||
<double>2.000000000000000</double>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>CutLineThickness</cstring>
|
||||
@@ -403,6 +415,12 @@
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
@@ -415,7 +433,7 @@
|
||||
<item row="2" column="1">
|
||||
<widget class="Gui::PrefDoubleSpinBox" name="spinBox_SymbolLineThickness">
|
||||
<property name="value">
|
||||
<double>0.6</double>
|
||||
<double>0.600000000000000</double>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>SymbolLineThickness</cstring>
|
||||
@@ -471,14 +489,14 @@ a Footprint display mode</string>
|
||||
<property name="decimals">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.001</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>9999.989999999999782</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.001000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>0.01</double>
|
||||
<double>0.010000000000000</double>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>patternScale</cstring>
|
||||
@@ -523,7 +541,7 @@ a Footprint display mode</string>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="Gui::PrefCheckBox" name="checkBox_BimServerBrowser">
|
||||
<property name="toolTip">
|
||||
<string>If this is selected, the "Open BimServer in browser"
|
||||
<string>If this is selected, the "Open BimServer in browser"
|
||||
button will open the Bim Server interface in an external browser
|
||||
instead of the FreeCAD web workbench</string>
|
||||
</property>
|
||||
@@ -574,6 +592,12 @@ instead of the FreeCAD web workbench</string>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
@@ -582,13 +606,13 @@ instead of the FreeCAD web workbench</string>
|
||||
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>Gui::PrefCheckBox</class>
|
||||
<extends>QCheckBox</extends>
|
||||
<class>Gui::PrefSpinBox</class>
|
||||
<extends>QSpinBox</extends>
|
||||
<header>Gui/PrefWidgets.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>Gui::PrefLineEdit</class>
|
||||
<extends>QLineEdit</extends>
|
||||
<class>Gui::PrefCheckBox</class>
|
||||
<extends>QCheckBox</extends>
|
||||
<header>Gui/PrefWidgets.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
@@ -597,8 +621,8 @@ instead of the FreeCAD web workbench</string>
|
||||
<header>Gui/PrefWidgets.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>Gui::PrefSpinBox</class>
|
||||
<extends>QSpinBox</extends>
|
||||
<class>Gui::PrefLineEdit</class>
|
||||
<extends>QLineEdit</extends>
|
||||
<header>Gui/PrefWidgets.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
@@ -614,24 +638,64 @@ instead of the FreeCAD web workbench</string>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>checkBox_ConversionFlat</receiver>
|
||||
<slot>setDisabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>20</x>
|
||||
<y>20</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>20</x>
|
||||
<y>20</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>checkBox_ConversionFast</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>checkBox_ConversionCut</receiver>
|
||||
<slot>setDisabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>20</x>
|
||||
<y>20</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>20</x>
|
||||
<y>20</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>checkBox_ConversionFast</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>label_ConversionTolerance</receiver>
|
||||
<slot>setDisabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>20</x>
|
||||
<y>20</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>20</x>
|
||||
<y>20</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>checkBox_ConversionFast</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>spinBox_ConversionTolerance</receiver>
|
||||
<slot>setDisabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>20</x>
|
||||
<y>20</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>20</x>
|
||||
<y>20</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
|
||||
@@ -30,6 +30,7 @@ import FreeCADGui
|
||||
from draftguitools import gui_shape2dview
|
||||
|
||||
QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP
|
||||
translate = FreeCAD.Qt.translate
|
||||
|
||||
|
||||
class BIM_Shape2DView(gui_shape2dview.Shape2DView):
|
||||
@@ -40,5 +41,50 @@ class BIM_Shape2DView(gui_shape2dview.Shape2DView):
|
||||
d["MenuText"] = QT_TRANSLATE_NOOP("BIM_Shape2DView", "Shape-based view")
|
||||
return d
|
||||
|
||||
def proceed(self):
|
||||
"""Proceed with the command if one object was selected."""
|
||||
# difference from Draft: it sets InPlace to False
|
||||
import DraftVecUtils
|
||||
if self.call is not None:
|
||||
self.end_callbacks(self.call)
|
||||
faces = []
|
||||
objs = []
|
||||
view = FreeCADGui.ActiveDocument.ActiveView
|
||||
vec = view.getViewDirection().negative()
|
||||
sel = FreeCADGui.Selection.getSelectionEx()
|
||||
for s in sel:
|
||||
objs.append(s.Object)
|
||||
for e in s.SubElementNames:
|
||||
if "Face" in e:
|
||||
faces.append(int(e[4:]) - 1)
|
||||
# print(objs, faces)
|
||||
commitlist = []
|
||||
FreeCADGui.addModule("Draft")
|
||||
if len(objs) == 1 and faces:
|
||||
_cmd = "Draft.make_shape2dview"
|
||||
_cmd += "("
|
||||
_cmd += "FreeCAD.ActiveDocument." + objs[0].Name + ", "
|
||||
_cmd += DraftVecUtils.toString(vec) + ", "
|
||||
_cmd += "facenumbers=" + str(faces)
|
||||
_cmd += ")"
|
||||
commitlist.append("sv = " + _cmd)
|
||||
commitlist.append("sv.InPlace = False")
|
||||
else:
|
||||
n = 0
|
||||
for o in objs:
|
||||
_cmd = "Draft.make_shape2dview"
|
||||
_cmd += "("
|
||||
_cmd += "FreeCAD.ActiveDocument." + o.Name + ", "
|
||||
_cmd += DraftVecUtils.toString(vec)
|
||||
_cmd += ")"
|
||||
commitlist.append("sv" + str(n) + " = " + _cmd)
|
||||
commitlist.append("sv" + str(n) + ".InPlace = False")
|
||||
n += 1
|
||||
if commitlist:
|
||||
commitlist.append("FreeCAD.ActiveDocument.recompute()")
|
||||
self.commit(translate("draft", "Create 2D view"),
|
||||
commitlist)
|
||||
self.finish()
|
||||
|
||||
|
||||
FreeCADGui.addCommand("BIM_Shape2DView", BIM_Shape2DView())
|
||||
|
||||
@@ -50,6 +50,7 @@ class BIM_Sketch:
|
||||
return False
|
||||
|
||||
def Activated(self):
|
||||
from draftutils import params
|
||||
issnap = False
|
||||
if hasattr(FreeCAD, "DraftWorkingPlane"):
|
||||
FreeCAD.DraftWorkingPlane.setup()
|
||||
@@ -64,6 +65,9 @@ class BIM_Sketch:
|
||||
sk.ViewObject.GridSize = s
|
||||
sk.ViewObject.GridSnap = True
|
||||
sk.MapMode = "Deactivated"
|
||||
sk.ViewObject.LineColor = params.get_param_view("DefaultShapeLineColor")
|
||||
sk.ViewObject.PointColor = params.get_param_view("DefaultShapeLineColor")
|
||||
sk.ViewObject.LineWidth = params.get_param_view("DefaultShapeLineWidth")
|
||||
p = FreeCAD.DraftWorkingPlane.getPlacement()
|
||||
p.Base = FreeCAD.DraftWorkingPlane.position
|
||||
sk.Placement = p
|
||||
|
||||
@@ -39,7 +39,7 @@ class BIM_SetWPFront:
|
||||
"ToolTip": QT_TRANSLATE_NOOP(
|
||||
"BIM_SetWPFront", "Set the working plane to Front"
|
||||
),
|
||||
"Accel": "Ctrl+Shift+1",
|
||||
"Accel": "W,P,1",
|
||||
}
|
||||
|
||||
def Activated(self):
|
||||
@@ -55,7 +55,7 @@ class BIM_SetWPSide:
|
||||
"ToolTip": QT_TRANSLATE_NOOP(
|
||||
"BIM_SetWPSide", "Set the working plane to Side"
|
||||
),
|
||||
"Accel": "Ctrl+Shift+3",
|
||||
"Accel": "W,P,3",
|
||||
}
|
||||
|
||||
def Activated(self):
|
||||
@@ -71,7 +71,7 @@ class BIM_SetWPTop:
|
||||
"ToolTip": QT_TRANSLATE_NOOP(
|
||||
"BIM_SetWPTop", "Set the working plane to Top"
|
||||
),
|
||||
"Accel": "Ctrl+Shift+2",
|
||||
"Accel": "W,P,2",
|
||||
}
|
||||
|
||||
def Activated(self):
|
||||
|
||||
Reference in New Issue
Block a user