Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
School project
#1
Hello. I'm struggling with a school project. I'm fairly new to Python, and I'm hoping for some great suggestions to solve my problem.

What I am trying to achieve is to simplify an operation up against the BIM program Solibri. By creating a script to, among other things, automate rule checking. Today one is dependent on a bat.file and an xml.file. the bat file opens the xml file and runs the references located there.
The references in the xml file are entered manually. What I hope to achieve is to create a script that retrieves the references automatically from given folders.

The text below show the bat file and the xml file.

Looking forward to hear from you.

Sincerely, Jan.

The bat-file

@ECHO off

ECHO Thank you for using Autorun
ECHO Autorun is running...

REM You can modify the line below to suit your needs.
"C:\Program Files\Solibri\SOLIBRI\Solibri.exe" "C:\Users\Desktop\Solibri Autorun\autorun.xml"

exit



the xml-file

<?xml version="1.0" encoding="ISO-8859-1"?>
<batch name="Simple Batch" default="root">
<!-- This is the starting task -->
<target name="root">

<openmodel
file="C:\Users\Desktop\Solibri Autorun\IFC\HJ3_Modell.ifc" />


<openmodel
file="C:\Users\janiv\Desktop\Solibri Autorun\IFC\SM3.ifc" />

<openclassification
file="C:\Users\Public\Solibri\SOLIBRI\Classifications\MEP Components.classification"/>

<openruleset
file="C:\Users\Public\Solibri\SOLIBRI\Rulesets\MEP Rules\Intersections in MEP Models.cset"/>

<check />

<autocomment zoom="TRUE" />

<createpresentation />

<bcfreport
file="C:\Users\Public\Solibri\SOLIBRI\Samples\reports\Found issues.bcfzip" version="2" />

<savemodel
file="C:\Users\Desktop\Solibri Autorun\SMC\BIMBAR.smc" />

<exit />

</target>
</batch>
Reply
#2
show what you have tried (python code).
Reply
#3
Thanks for reply.

Som nevnt er jeg ny til koding. For dette prosjektet har jeg i hovedsak brukt Sublime Text 3 og tkinter.
I do not have much. Just breadcrumbs that I have tried to put together, without success. I have tried different features but not found the right one. I know what I want the function to be.

I'm not looking for a conclusion. Just set in the right direction.

I add what I have, but I know it's wrong and it does not work.

Sincerely, Jan.


# Importerer tkinter. Dette følger med, er innebygd i Python
from tkinter import *
from PIL import ImageTk,Image
from tkinter import filedialog

# Dette må stå først
root = Tk()
# Endre overskriften på boksen
root.title("BIMBARIANS Autorun")
root.iconbitmap('C:/Users/jan/Desktop/SolibriAutorun/Ikon/BIMBARIANS.ico')
root.geometry("400x400")

def button_open1():
	global my_file
	root.filename = filedialog.askopenfilename(initialdir="C:/Users/jan/Desktop/SolibriAutorun", title="Select A File", filetypes=(("IFC files", "*.ifc"),("all files", "*.*")))
	my_label = Label(root, text=root.filename).pack()
	#my_image = ImageTk.PhotoImage(Image.open(root.filename))
	#my_image_label = Label(image=my_image).pack()

button_1 = Button(root, text="Add IFC", padx=59, pady=20, command=button_open1)
button_2 = Button(root, text="Add ruleset", padx=46, pady=20, command=open)
button_3 = Button(root, text="Add classification", padx=33, pady=20, command=open)
button_4 = Button(root, text="Run Solibri Autorun", padx=38, pady=20, command=open) 

button_1.grid(row=1, column=0)
button_2.grid(row=2, column=0)
button_3.grid(row=3, column=0)
button_4.grid(row=4, column=0)



mainloop()
# Når man lukker vinduet, slutter man loopen
Larz60+ write Jan-22-2021, 05:08 PM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.

Fixed for you this time. Please use bbcode tags on future posts.
Reply
#4
Please show your code cause its a lot difficult to understand what are trying to say now without proper code.
Thanks
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  my python project for school vavervirus 2 601 Oct-12-2023, 03:28 AM
Last Post: buran
Shocked School project -- need help with it it says syntax error XPGKNIGHT 6 3,255 Aug-11-2022, 08:43 PM
Last Post: deanhystad
  Python School Project andreas30298 2 2,101 Nov-12-2020, 09:58 AM
Last Post: Axel_Erfurt
  I need help for a school project IndyNeerhoff 1 2,039 Sep-28-2019, 08:28 PM
Last Post: Gribouillis
  [Tkinter] Tkinter project school Kersow 2 2,444 Apr-08-2019, 08:45 PM
Last Post: Larz60+
  card dealer school project kalle1234 5 9,608 Jan-05-2019, 09:21 PM
Last Post: ichabod801
  Small game (school project) Ganesh 7 5,586 Nov-08-2017, 09:04 PM
Last Post: Ganesh

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020