Search found 57 matches

Go to advanced search

by Chri1
Mon Oct 14, 2019 8:39 pm
Forum: Python scripting and macros
Topic: origin of face of a prism, map rectangle to face
Replies: 3
Views: 433

origin of face of a prism, map rectangle to face

Hi I have a prism, select one face of the prism, make the face to actual workingplane and draw a rectangle (-> obj) Now I map the rectangle to the face by code: .... bk = FreeCADGui.Selection.getSelectionEx()[0] #The selected face flae = bk.SubElementNames[0] ... P0 = obj.Placement.Base #The origin ...
by Chri1
Mon Oct 14, 2019 6:47 pm
Forum: Python scripting and macros
Topic: pause macro till other macro is finished
Replies: 5
Views: 458

Re: pause macro till other macro is finished

I found a dirty solution: Because my macro requires, that a face of a prism has to be selected, before it starts. When DraftTools.Rectangle().Activated() is finished, the new rectangle is selected and it has no subelements. -> I made an observer (addEventCallback "SoEvent"), which observes: ... sel ...
by Chri1
Sat Oct 12, 2019 12:14 pm
Forum: Python scripting and macros
Topic: addEventCallPivy - type of event
Replies: 5
Views: 411

Re: addEventCallPivy - type of event

Joel_graff wrote:
Fri Oct 11, 2019 9:41 am
Either one is fine.
I'll stay at addEventCallback()
Somehow it seems more handy for me ...

Incidentally, I just noticed that I forgot on "back" in my post (addEventCallback)

Thanks to all of you
by Chri1
Thu Oct 10, 2019 9:52 am
Forum: Python scripting and macros
Topic: addEventCallPivy - type of event
Replies: 5
Views: 411

addEventCallPivy - type of event

Hi I am able, to make an observer by using addEventCall. Apparently its better to use addEventCallPivy. Really, why? I made an "Soevent" and don't know, how to recognize, which event has happened: With addEventCall I used: if arg["Type"] == "SoKeyboardEvent": ..... But with addEventCallPivy? (The st...
by Chri1
Thu Oct 10, 2019 9:21 am
Forum: Python scripting and macros
Topic: pause macro till other macro is finished
Replies: 5
Views: 458

Re: pause macro till other macro is finished

Before I can use Draft.makeRectangle(), I would to have to take care about userinput by my own (Observer,...), Drafttools-Rectangle does this anyway. I could copy the code of Drafttools in an own macro and adjust it a little bit (insert a call to another function, after it's job is done) , but I'm r...
by Chri1
Wed Oct 09, 2019 6:38 pm
Forum: Python scripting and macros
Topic: pause macro till other macro is finished
Replies: 5
Views: 458

pause macro till other macro is finished

Hi In a macro I use DrafTools.Rectangle The problem is, that the code does not stop till rectangle is finished ... r=None r = DraftTools.Rectangle().Activated() ###Here it should wait, till rectangle is finished print("Rectangle finished") # This appears immediately before the rectangle exists ... s...
by Chri1
Tue Oct 08, 2019 7:27 pm
Forum: Forum in Deutsch
Topic: map on face, Anzeigereihenfolge
Replies: 5
Views: 165

Re: map on face, Anzeigereihenfolge

Ja, das mit der Position habe ich gerade ausprobiert: Beide liegen parallel zur x-y-Ebene, Placement/Position/z beim einen=10mm, beim anderen 10,01mm: Funktioniert voll. (10,001 funktioniert nicht mehr). Aber irgendwie ... Krückenlösung. Und beim map on face (Attachement Offset/Position/z): Mit Sket...
by Chri1
Tue Oct 08, 2019 5:26 pm
Forum: Forum in Deutsch
Topic: map on face, Anzeigereihenfolge
Replies: 5
Views: 165

Re: map on face, Anzeigereihenfolge

Mal abgesehen vom map on face:

Habe 2 teilweise überlappende Rechtecke (Wie 2 Papiere: eines rot, das andere blau):
Ob das rote oder das Blaue oben liegt und das andere verdeckt, soll umschaltbar sein.
by Chri1
Tue Oct 08, 2019 5:00 pm
Forum: Forum in Deutsch
Topic: map on face, Anzeigereihenfolge
Replies: 5
Views: 165

map on face, Anzeigereihenfolge

Hi Wenn ich z.B ein rot gefülltes Rechteck auf eine Quaderfläche heften will: Im Sketcher die Fläche auswählen, "Neue Skizze erstellen", Rechteck zeichnen. Soweit ok. Oder? Nun das Problem: Das Rechteck ist nicht rot gefüllt, ich kann zwar die Linienfarbe ändern, aber Änderung der Flächenfarbe bewir...
by Chri1
Sat Sep 14, 2019 9:52 am
Forum: Forum in Deutsch
Topic: Schaltflächen für Funktionen eines Makro
Replies: 5
Views: 291

Re: Schaltflächen für Funktionen eines Makro

Hab ich befürchtet.
Habe nun ein 2. Makro gemacht und dem eine Schaltfläche zugeordnet:

Code: Select all

import meinmakro
meinmakro.meineKlasse.variante()    #def-Name  variante
Nix Tragisches, wäre aber doch fein, wenn man das irgendwann innerhalb der Schaltfläche erledigen könnte.

LG
Chri

Go to advanced search