Example #1
0
    def showGraph4File(self):
        import DDADisplay
        DDADisplay.clearDocument()
        
        Base.DDAObserver.lock = True
        
        from DDADatabase import dl_database as database
        boundaryNodes = database.boundaryNodes
        if len(boundaryNodes)>0:
            Base.addPolyLine2Document('BoundaryLine', ifStore2Database=False)
            print 'draw boundary lines : ' , len(boundaryNodes)

        points = database.fixedPoints
        if len(points)>0:
            Base.addCircles2Document('FixedPoint')
            print 'draw fixed points : ' , len(points)

        points = database.measuredPoints
        if len(points)>0:
            Base.addCircles2Document('MeasuredPoint')
            print 'draw measured points : ' , len(points)

        points = database.loadingPoints
        if len(points)>0:
            Base.addCircles2Document('LoadingPoint')
        print 'draw loading points : ' , len(points)

        points = database.holePoints
        if len(points)>0:
            Base.addCircles2Document('HolePoint')
        print 'draw hole points : ' , len(points)
        
        Base.DDAObserver.lock = False
Example #2
0
 def Activated(self, name="None"):
     path = os.getcwd()
     import DDADisplay
     DDADisplay.clearDocument()
     import Base
     os.chdir(Base.__workbenchPath__)
     import DDAGui
     FreeCADGui.runCommand("DDA_Test")  # it is in DDAGui.pyd
     os.chdir(path)
Example #3
0
    def Activated(self, name="None"):
        import DDADisplay, Base
        DDADisplay.clearDocument()
        Base.setCurrentDDACommand(self)

        def postPlay():
            FreeCADGui.runCommand("DDA_Test")  # it is in DDAGui.pyd

        Base.delaycommand(postPlay)
Example #4
0
    def showGraph4File(self):
        import DDADisplay
        DDADisplay.clearDocument()

        from DDADatabase import dc_inputDatabase
        import Base
        
        Base.DDAObserver.lock = True

        from DDADatabase import dl_database as database
        boundaryNodes = database.boundaryNodes
        if len(boundaryNodes)>0:
            Base.addPolyLine2Document('BoundaryLine', ifStore2Database=False)
#            self.drawLines(boundaryNodes, 'BoundaryLine')
            print 'draw boundary lines : ' , len(boundaryNodes)
        
        nums = 0        
        lines = dc_inputDatabase.jointLines
        # the viewProvider will take data from dc_inputDatabase.jointLines 
#        self.drawLines( [lines[0].startPoint , lines[0].endPoint] ,'JointLine' , 0)
        if len(lines)>0:
            Base.addLines2Document('JointLine') 
            print 'draw joints : ' , len(lines)
        
        points = dc_inputDatabase.fixedPoints
#        self.drawCircles(points, Base.__radius4Points__, 'FixedPoint')
        if len(points)>0:
            Base.addCircles2Document('FixedPoint')
            print 'draw fixed points : ' , len(points)

        points = dc_inputDatabase.measuredPoints
#        self.drawCircles(points , Base.__radius4Points__, 'MeasuredPoint')
        if len(points)>0:
            Base.addCircles2Document('MeasuredPoint')
            print 'draw measured points : ' , len(points)

        points = dc_inputDatabase.loadingPoints
#        self.drawCircles(points , Base.__radius4Points__, 'LoadingPoint')
        if len(points)>0:
            Base.addCircles2Document('LoadingPoint')
        print 'draw loading points : ' , len(points)

        points = dc_inputDatabase.holePoints
#        self.drawCircles(points , Base.__radius4Points__, 'HolePoint')
        if len(points)>0:
            Base.addCircles2Document('HolePoint')
        print 'draw hole points : ' , len(points)
                                
        Base.recomputeDocument()
        
        Base.DDAObserver.lock = False
Example #5
0
    def Activated(self, name="None"):
        path = os.getcwd()
        import DDADisplay
        DDADisplay.clearDocument()
        import Base
        os.chdir(Base.__workbenchPath__)

        #        file = open('dg_ff.c' , 'wb')
        #        file.write(Base.__currentProjectPath__+'/data.dg')
        #        file.close()
        #
        #
        import DDAGui
        print Base.__currentProjectPath__
        DDAGui.setCurrentProjectPath(Base.__currentProjectPath__)
        FreeCADGui.runCommand("DDA_Test")  # it is in DDAGui.pyd
        os.chdir(path)
Example #6
0
    def Activated(self, name="None"):
        path = os.getcwd()
        import DDADisplay
        DDADisplay.clearDocument()
        import Base
        os.chdir(Base.__workbenchPath__)
        
        
#        file = open('dg_ff.c' , 'wb')
#        file.write(Base.__currentProjectPath__+'/data.dg')
#        file.close()
#        
#        
        import DDAGui
        print Base.__currentProjectPath__
        DDAGui.setCurrentProjectPath( Base.__currentProjectPath__)
        FreeCADGui.runCommand("DDA_Test")  # it is in DDAGui.pyd
        os.chdir(path)
Example #7
0
    def Activated(self, name="None"):
        FreeCAD.Console.PrintMessage( 'Creator activing\n')
        if FreeCAD.activeDDACommand:
            FreeCAD.activeDDACommand.finish()
        self.doc = FreeCAD.ActiveDocument
        self.view = FreeCADGui.ActiveDocument.ActiveView
        self.featureName = name
        
        if not self.doc:
            FreeCAD.Console.PrintMessage( 'FreeCAD.ActiveDocument get failed\n')
            self.finish()
        else:
            FreeCAD.activeDDACommand = self  # FreeCAD.activeDDACommand 在不同的时间会接收不同的命令
            import Base
            Base.__currentStage__ = 'DF' 
            #self.ui.show()

        # Hide Panel
        Base.setCurrentDDACommand(self)
        self.__mainWidget.show()
        
        # clear Dcoument 
        import DDADisplay
        DDADisplay.clearDocument()