Exemplo n.º 1
0
    def open_file(self, path):
        options = Dispatch('pfcls.pfcRetrieveModelOptions')
        o = options.Create()
        file = Dispatch('pfcls.pfcModelDescriptor')

        # VBAPI fails if it is given a creo file with the version number appended
        path = re.sub(r"\.prt(\.[0-9]+)", ".prt", path)

        f = file.CreateFromFilename(path)
        self.models.append(self.session.RetrieveModelWithOpts(f, o))
        self.session.OpenFile(f)
Exemplo n.º 2
0
Arquivo: api.py Projeto: stnoah1/mcb
    def open_file(self, path):
        options = Dispatch('pfcls.pfcRetrieveModelOptions')
        o = options.Create()
        file = Dispatch('pfcls.pfcModelDescriptor')

        # VBAPI fails if it is given a creo file with the version number appended
        path = re.sub(r"\.prt(\.[0-9]+)", ".prt", path)

        f = file.CreateFromFilename(path)
        self.model = self.session.RetrieveModelWithOpts(f, o)
        self.models.append(self.model)
        self.session.SetConfigOption("regen_failure_handling",
                                     "no_resolve_mode")
        self.session.OpenFile(f)
        return self.model