FreeCAD supports Python as a scripting language which allows the creation of 3D parts based on variables. This is great for building libraries which support customizable part creation.

As a first attempt I created the following test script. When executed in FreeCAD 0.13 it creates a rod 10mm x 10mm x 50mm with a notch in it. It then removes a cube measuring 4mm x 4mm x 4mm from one end. Here is what the hierarchy looks like: And here is the script:

```import FreeCAD, FreeCADGui, Part

doc = App.activeDocument()

rodbasepts = list()
rodbasepts.append(App.Vector(0, 0, 0))
rodbasepts.append(App.Vector(0, 10, 0))
rodbasepts.append(App.Vector(10, 10, 0))
rodbasepts.append(App.Vector(10, 0, 0))
rodbasepts.append(App.Vector(6, 0, 0))
rodbasepts.append(App.Vector(6, 2, 0))
rodbasepts.append(App.Vector(4, 2, 0))
rodbasepts.append(App.Vector(4, 0, 0))
rodbasepts.append(App.Vector(0, 0, 0))
rodbase = Part.makePolygon(rodbasepts)
rodbasefilled = Part.Face(rodbase)
rod = rodbasefilled.extrude(App.Vector(0, 0, 50))
#rod.Placement = App.Placement(App.Vector(10, 0, 0), App.Rotation(0, 0, 0, 1))
rodpart.Shape = rod

cubebasepts = list()
cubebasepts.append(App.Vector(0, 0, 0))
cubebasepts.append(App.Vector(0, 4, 0))
cubebasepts.append(App.Vector(4, 4, 0))
cubebasepts.append(App.Vector(4, 0, 0))
cubebasepts.append(App.Vector(0, 0, 0))
cubebase = Part.makePolygon(cubebasepts)
cubebasefilled = Part.Face(cubebase)
cube = cubebasefilled.extrude(App.Vector(0, 0, 4))
{"ft_lang_label":"__label__en","ft_lang_prob":0.7066027,"math_prob":0.9722162,"size":2373,"snap":"2022-27-2022-33","text_gpt3_token_len":721,"char_repetition_ratio":0.21443647,"word_repetition_ratio":0.25082508,"special_character_ratio":0.27981457,"punctuation_ratio":0.24760076,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.98425734,"pos_list":[0,1,2,3,4],"im_url_duplicate_count":[null,7,null,7,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-08-15T12:00:44Z\",\"WARC-Record-ID\":\"<urn:uuid:2a26a41b-4c68-4b79-9b3b-341e046c89fe>\",\"Content-Length\":\"52113\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:2132cab6-6f67-4914-8507-d063e14b1cb0>\",\"WARC-Concurrent-To\":\"<urn:uuid:0687b818-91b2-4525-bc2b-8acbf10b7386>\",\"WARC-IP-Address\":\"85.214.145.215\",\"WARC-Target-URI\":\"http://www.britishideas.com/2012/06/24/python-cad-scripting/\",\"WARC-Payload-Digest\":\"sha1:Z3TJQV67IN3TOTPCSCZSVFCZLJC7FAQV\",\"WARC-Block-Digest\":\"sha1:C7YVGKKGZF6LUBCDTBFE53CQ4AJYGKO6\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-33/CC-MAIN-2022-33_segments_1659882572174.8_warc_CC-MAIN-20220815115129-20220815145129-00119.warc.gz\"}"}