So I've been making a Macro which takes dimensions and outputs a drawing svg. I managed to code it to create the object and project it to the page, but I for the life of mine am unable to figure out how to add atleast the basic dimensions like length and height of the object through python console.
this is the projection code if it matters:
Code: Select all
App.activeDocument().addObject('TechDraw::DrawProjGroup', 'testProj')
App.activeDocument().testPage.addView(App.activeDocument().testProj)
App.ActiveDocument.testProj.Source = App.ActiveDocument.Body
App.activeDocument().testProj.addProjection('Front')
App.activeDocument().testProj.Anchor.Direction = FreeCAD.Vector(0.000,0.000,1.000)
App.activeDocument().testProj.Anchor.RotationVector = FreeCAD.Vector(1.000,0.000,0.000)
App.activeDocument().testProj.Anchor.XDirection = FreeCAD.Vector(1.000,0.000,0.000)
App.activeDocument().testProj.addProjection('Bottom')
App.activeDocument().testProj.addProjection('Right')
App.activeDocument().testProj.Y = '150.00 mm'
App.activeDocument().testProj.X = '200.00 mm'
FreeCAD.getDocument('Unnamed').getObject('ProjItem002').HardHidden = True
FreeCAD.getDocument('Unnamed').getObject('ProjItem001').HardHidden = True
App.activeDocument().recompute()