Search found 958 matches

Go to advanced search

by keithsloan52
Sat Sep 14, 2019 5:12 pm
Forum: Python scripting and macros
Topic: Setting an enumerate property.
Replies: 7
Views: 115

Re: Setting an enumerate property.

Still a mystery to me as to why it requires a double reference I suppose that this property gets a special treatment internally : - when it is set to a list of strings, the enum gets populated - when it is set to an integer, the index in the EXISTING enum is set ['rad','deg'].index(aunit) # This is...
by keithsloan52
Sat Sep 14, 2019 4:51 am
Forum: Python scripting and macros
Topic: Setting an enumerate property.
Replies: 7
Views: 115

Re: Setting an enumerate property.

TheMarkster wrote:
Fri Sep 13, 2019 9:28 pm

Code: Select all

obj.aunit = ['rad','deg'].index(aunit)
Thanks, found I actually had to code

Code: Select all

obj.aunit=['rad','deg']
obj.aunit=['rad','deg'].index(aunit)
Still a mystery to me as to why it requires a double reference
by keithsloan52
Fri Sep 13, 2019 5:21 pm
Forum: Python scripting and macros
Topic: Setting an enumerate property.
Replies: 7
Views: 115

Re: Setting an enumerate property.

Okay my class definition for a python object is class GDMLTube(GDMLcommon) : def __init__(self, obj, rmin, rmax, z, startphi, deltaphi, aunit, \ lunit, material): '''Add some custom properties to our Tube feature''' obj.addProperty("App::PropertyLength","rmin","GDMLTube","Inside Radius").rmin=rmin o...
by keithsloan52
Fri Sep 13, 2019 5:07 pm
Forum: Python scripting and macros
Topic: Setting an enumerate property.
Replies: 7
Views: 115

Re: Setting an enumerate property.

Okay I have a Object with an enumerate property ... But I would like to now set the value with some code. How can I do that? What exactly is an enumeration? Like a list of strings? Then it's not a value. If you want to enter a value, you need to add a numeric property. obj.addProperty("App::Propert...
by keithsloan52
Fri Sep 13, 2019 4:19 pm
Forum: Python scripting and macros
Topic: Setting an enumerate property.
Replies: 7
Views: 115

Setting an enumerate property.

Okay I have a Object with an enumerate property obj.addProperty("App::PropertyEnumeration","aunit","GDMLTube","aunit") obj.aunit=['rad','deg'] obj.aunit=0 Which iniitalises the property to 'rad'. Don't understand the double setting of obj.aunit, but went by something I found on the web and it seems ...
by keithsloan52
Mon Sep 09, 2019 3:16 pm
Forum: Python scripting and macros
Topic: onchange and execute functions of python object.
Replies: 22
Views: 333

Re: onchange and execute functions of python object.

Hi Joel Don't think it is anything to do with GDML. My import creates a number of objects implemented as FreeCAD Python Objects. Normally I would expect people to export to GDML, but somebody tested saving as a FreeCAD file FCStd. When I/they do a reload of the file I get the messages and nothing di...
by keithsloan52
Mon Sep 09, 2019 11:49 am
Forum: Python scripting and macros
Topic: onchange and execute functions of python object.
Replies: 22
Views: 333

Re: onchange and execute functions of python object.

Okay have added lots of print statements to onChange functions but still struggling to understand what is going on. Init: Entering event loop Init: Processing command line files GDMLBox_WorldBox State : ['Touched', 'Restore'] prop : Proxy GDMLBox_WorldBox State : ['Touched', 'Restore'] prop : lunit ...
by keithsloan52
Mon Sep 09, 2019 3:31 am
Forum: Python scripting and macros
Topic: onchange and execute functions of python object.
Replies: 22
Views: 333

Re: onchange and execute functions of python object.

Hi Guys @Joel_graff @DeepSOIC @Chris_G any explanation of what is happening?
by keithsloan52
Mon Sep 09, 2019 3:17 am
Forum: Python scripting and macros
Topic: onchange and execute functions of python object.
Replies: 22
Views: 333

Re: onchange and execute functions of python object.

Okay changed my translate function to immediately return with the passed shape and I still get the same messages on load of saved file,
so that does not explain where the problem lies.
by keithsloan52
Sun Sep 08, 2019 8:24 pm
Forum: Python scripting and macros
Topic: Help with scripted Loft.
Replies: 9
Views: 188

Re: Help with scripted Loft.

Thanks works a treat.

Was erring away from clone as assumed radius was fixed i.e radius in clone was the same as original and if I changed one the other
would also change but not to scaled value.

P.S.Checked your profile and went to your website. EXTREMELY NICE GUITARS

Go to advanced search