Skip to content

Commit

Permalink
minor fix for launching the macro by command line
Browse files Browse the repository at this point in the history
  • Loading branch information
easyw committed Jul 18, 2018
1 parent 52c388e commit 80cf237
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 41 deletions.
2 changes: 1 addition & 1 deletion InitGui.py
Expand Up @@ -14,7 +14,7 @@
global myurlKWB
myurlKWB='https://github.com/easyw/kicadStepUpMod'
global mycommitsKWB
mycommitsKWB=123 #v7.7.2
mycommitsKWB=124 #v7.7.2

import FreeCAD, FreeCADGui, Part, os, sys
import re, time
Expand Down
40 changes: 20 additions & 20 deletions demo/kicad-StepUp-tools.FCMacro
Expand Up @@ -441,7 +441,7 @@ import unicodedata
pythonopen = builtin.open # to distinguish python built-in open function from the one declared here

## Constant definitions
___ver___ = "7.3.3.1"
___ver___ = "7.3.3.2"
__title__ = "kicad_StepUp"
__author__ = "maurice & mg"
__Comment__ = 'Kicad STEPUP(TM) (3D kicad board and models exported to STEP) for FreeCAD'
Expand Down Expand Up @@ -4516,6 +4516,25 @@ def checkFCbug(fcv):
return True
return False
##
def find_skt_in_Doc():
""" is returning a list of Sketches and relative Group"""
#print sel_name
sk_list=[]
for MObject1 in FreeCAD.ActiveDocument.Objects:
if MObject1.TypeId=="App::Part":
#if hasattr(MObject1 ,"Group"):
if MObject1.Group is not None:
for MObject2 in MObject1.Group:
#print MObject1.Name,MObject2.TypeId
if 'Sketch' in MObject2.TypeId:
#print MObject2.TypeId
if MObject2.Name not in sk_list:
sk_list.append([MObject2.Name,MObject1.Name])
#return MObject2.Name, MObject1.Name
#print 'loop closed'
return sk_list

###

def Export2MCAD(blacklisted_model_elements):
global bbox_all, bbox_list, fusion, show_messages, last_pcb_path
Expand Down Expand Up @@ -16976,25 +16995,6 @@ def check_geom(sk_name, ofs=None):

##

def find_skt_in_Doc():
""" is returning a list of Sketches and relative Group"""
#print sel_name
sk_list=[]
for MObject1 in FreeCAD.ActiveDocument.Objects:
if MObject1.TypeId=="App::Part":
#if hasattr(MObject1 ,"Group"):
if MObject1.Group is not None:
for MObject2 in MObject1.Group:
#print MObject1.Name,MObject2.TypeId
if 'Sketch' in MObject2.TypeId:
#print MObject2.TypeId
if MObject2.Name not in sk_list:
sk_list.append([MObject2.Name,MObject1.Name])
#return MObject2.Name, MObject1.Name
#print 'loop closed'
return sk_list

###
## getGridOrigin
def getGridOrigin(dt):
match = re.search(r'\(grid_origin (.+?) (.+?)\)', dt, re.MULTILINE|re.DOTALL)
Expand Down
40 changes: 20 additions & 20 deletions kicadStepUptools.py
Expand Up @@ -441,7 +441,7 @@
pythonopen = builtin.open # to distinguish python built-in open function from the one declared here

## Constant definitions
___ver___ = "7.3.3.1"
___ver___ = "7.3.3.2"
__title__ = "kicad_StepUp"
__author__ = "maurice & mg"
__Comment__ = 'Kicad STEPUP(TM) (3D kicad board and models exported to STEP) for FreeCAD'
Expand Down Expand Up @@ -4516,6 +4516,25 @@ def checkFCbug(fcv):
return True
return False
##
def find_skt_in_Doc():
""" is returning a list of Sketches and relative Group"""
#print sel_name
sk_list=[]
for MObject1 in FreeCAD.ActiveDocument.Objects:
if MObject1.TypeId=="App::Part":
#if hasattr(MObject1 ,"Group"):
if MObject1.Group is not None:
for MObject2 in MObject1.Group:
#print MObject1.Name,MObject2.TypeId
if 'Sketch' in MObject2.TypeId:
#print MObject2.TypeId
if MObject2.Name not in sk_list:
sk_list.append([MObject2.Name,MObject1.Name])
#return MObject2.Name, MObject1.Name
#print 'loop closed'
return sk_list

###

def Export2MCAD(blacklisted_model_elements):
global bbox_all, bbox_list, fusion, show_messages, last_pcb_path
Expand Down Expand Up @@ -16976,25 +16995,6 @@ def check_geom(sk_name, ofs=None):

##

def find_skt_in_Doc():
""" is returning a list of Sketches and relative Group"""
#print sel_name
sk_list=[]
for MObject1 in FreeCAD.ActiveDocument.Objects:
if MObject1.TypeId=="App::Part":
#if hasattr(MObject1 ,"Group"):
if MObject1.Group is not None:
for MObject2 in MObject1.Group:
#print MObject1.Name,MObject2.TypeId
if 'Sketch' in MObject2.TypeId:
#print MObject2.TypeId
if MObject2.Name not in sk_list:
sk_list.append([MObject2.Name,MObject1.Name])
#return MObject2.Name, MObject1.Name
#print 'loop closed'
return sk_list

###
## getGridOrigin
def getGridOrigin(dt):
match = re.search(r'\(grid_origin (.+?) (.+?)\)', dt, re.MULTILINE|re.DOTALL)
Expand Down

1 comment on commit 80cf237

@LukeLER
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!! 👍

Please sign in to comment.