When I run the Code


#1

I Launched the Glyph this morning is showing me this Code in “Macro panel” Run, i did but is not working.
def drawSymmetries( self, Layer ):

currentZoom = self.getScale()

l = Layer.copy()

if l.pathCount() > 1:

l.removeOverlap()

ns = l.selectedNodeSet()

if len(ns) == 1: return

if len(ns) == 0:

sel = []

for p in Layer.paths:

Blockquote “When I run the Code, this is what i get”

File “”, line 10
for p in Layer.paths:
^
IndentationError: expected an indented block

Thanks


#2

Can you post the code again but inside a three grave ```

Like this:
```
code here
```


#3

Thanks George. here is the image


#4

Please post the code a explained above. I can’t see line 10.

You are missing an indentation. That might be caused by a mix of spaces and tabs.


#5

The code is not complete. There is no indented line after the colon. Where did you get the code from?


#6

@George Sorry about that, here is the line 10 highlighted.
@Mekkablue, I launched my App this morning and the code pop up in macro panel. i did run the code but this is the reply i get "File “”, line 10
for p in Layer.paths:
^
IndentationError: expected an indented block
"


thanks guys for the assistance.


#7

As @mekkablue mentioned, there’s no indented code following line 10. If there’s no code after line 10, that’s part of the problem. You’re missing some code. Also, the def looks to be a class method definition. It’s unlikely to work as you expect unless you’re calling that function with the first argument defined as the code expects.

Posting the entire code between two groups of ``` in a reply in this forum as @GeorgSeifert mentioned earlier might help in troubleshooting. And perhaps mentioning what you’re trying to do would help.


#8

thanks this is how i saw the code and the code finished in line 10, i have cancelled it, cause i could remember how the code get here too.