Macro for BIM simulation of work
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: Macro for BIM simulation of work
You do not need the animation wb for a first implementation because nothing is moving. You just need to use the python time module for the breaks, change transparency of the object and change visibility of the object in the regard of your new date property. The most cumbersome is to generate the input for this. Since every object needs a date. This could be a thousand or more dates. If such information could be imported it would be cool.
@Yorik and other developer:
Do we have a property which represents a time in words a date and or a time? Would be cool to have such property type for the stuff walpa would like to do. AFAIK we do not have such property type.
@Yorik and other developer:
Do we have a property which represents a time in words a date and or a time? Would be cool to have such property type for the stuff walpa would like to do. AFAIK we do not have such property type.
Re: Macro for BIM simulation of work
Making the Gantt itself will be required for visualization inside the FRC (if it is to plagiarize the Naviswork interface), but to do the planning, in my opinion, at the moment, it is best to keep both softs integrated. In the future, who knows ...bernd wrote: How about if you make your own gant chart and how about importing gant charts from MS project.
At the moment I do not have MS Project installed on my computer, but I know that it exports in CSV (and it's how NAVISWORK imports the data).
After xml, I'll do csv
Yes, but with a little less resources, but very "usable".bernd wrote: how about projectlibre? Do you use it in daily buissness...Is it comparable like LibreOffice writer with word and calc with excel?
Re: Macro for BIM simulation of work
Having our own gant chart in FC would for sure be the best... And some day we will
As for the animation WB, I was thinking if not using it, maybe at least some of its code can be reused, also exploded assembly animation viewtopic.php?t=9028 has elements that are close to this, but yes it all depends how far one wishes to animate this, it can also be done in a much more simple way, just change transparency and visibility of objects as suggested by bernd.
As for the animation WB, I was thinking if not using it, maybe at least some of its code can be reused, also exploded assembly animation viewtopic.php?t=9028 has elements that are close to this, but yes it all depends how far one wishes to animate this, it can also be done in a much more simple way, just change transparency and visibility of objects as suggested by bernd.
Re: Macro for BIM simulation of work
First thing to check would IMO be to check if maybe IFC has support for this?bernd wrote:@Yorik and other developer:
Do we have a property which represents a time in words a date and or a time? Would be cool to have such property type for the stuff walpa would like to do. AFAIK we do not have such property type.
- microelly2
- Veteran
- Posts: 4688
- Joined: Tue Nov 12, 2013 4:06 pm
- Contact:
Re: Macro for BIM simulation of work
Most things in the video can be done with the Explosion Animation WB, there is only one detail - the growing columns which is not supported.
So you have to assemble your parts and define the ways the componentes flow in.
However if you want more comfort
multi camera view, growing objects, text information inside please request for details here,
it's an interesting task to combine an assembly process with an schedule.
Would be nice to get an animation tool for interactive visualization of such a process.
So you have to assemble your parts and define the ways the componentes flow in.
However if you want more comfort
multi camera view, growing objects, text information inside please request for details here,
it's an interesting task to combine an assembly process with an schedule.
Would be nice to get an animation tool for interactive visualization of such a process.
Re: Macro for BIM simulation of work
I need a tutorial, can not learn alone how to use this WB.microelly2 wrote:Most things in the video can be done with the Explosion Animation WB, ...
- microelly2
- Veteran
- Posts: 4688
- Joined: Tue Nov 12, 2013 4:06 pm
- Contact:
Re: Macro for BIM simulation of work
https://www.youtube.com/watch?v=t1jESJO2am4&t=312swalpa wrote:I need a tutorial, can not learn alone how to use this WB.microelly2 wrote:Most things in the video can be done with the Explosion Animation WB, ...
https://www.youtube.com/watch?v=5FGVNQLp1sA
https://www.youtube.com/watch?v=GB6lTOFM2p4
https://www.youtube.com/watch?v=aZaUjQURT04
Re: Macro for BIM simulation of work
Another problem:
Testing a piece of code and giving different results in IDLE Python and FRC console. Maybe Python version difference?
Code to paste on console:
ProjectLibre interface, expected Result (IDLE) and xml file to test:
Testing a piece of code and giving different results in IDLE Python and FRC console. Maybe Python version difference?
Code to paste on console:
Code: Select all
import xml.etree.ElementTree as ET
from datetime import datetime, date
from PySide import QtCore, QtGui
class PlannerData:
def __init__(self, file):
self.file = file
self.taskData = {}
self.startDate = None
self.finishDate = None
self.projPeriod = None
self.seqDays = []
self.percentConclTask = None
def getXmlData(self):
"gets data in the document ProjectLibre xml"
tree = ET.parse(self.file)
root = tree.getroot()
#gets data of the tasks
task = root.findall("{http://schemas.microsoft.com/project}Tasks")
for parent in task:
for child in parent:
a=[]
uid = child.findtext("{http://schemas.microsoft.com/project}UID")
name = child.findtext("{http://schemas.microsoft.com/project}Name")
start = child.findtext("{http://schemas.microsoft.com/project}Start")
start = datetime.strptime(start, '%Y-%m-%dT%H:%M:%S').date()
finish = child.findtext("{http://schemas.microsoft.com/project}Finish")
finish = datetime.strptime(finish, '%Y-%m-%dT%H:%M:%S').date()
period = finish-start
period = period.days
#list of data of task
a.append(uid)
a.append(name)
a.append(start)
a.append(finish)
a.append(period)
self.taskData[uid] = a
#gets data of the project period
start2 = root.findtext("{http://schemas.microsoft.com/project}StartDate")
self.startDate = datetime.strptime(start2, '%Y-%m-%dT%H:%M:%S').date()
finish2 = root.findtext("{http://schemas.microsoft.com/project}FinishDate")
self.finishDate = datetime.strptime(finish2, '%Y-%m-%dT%H:%M:%S').date()
period = self.finishDate - self.startDate
self.projPeriod = period.days
#gets the sequence of days between the start and end date of the project for use in Simulation
dat = self.startDate
while dat <= self.finishDate:
self.seqDays.append(dat)
dat = date.toordinal(dat)+1
dat = date.fromordinal(dat)
return self.taskData#, self.startDate, self.finishDate#, self.projPeriod, self.seqDays
def getCsvData(self):
"gets data in the document Csv"
pass
def calcPercentConclTask(self, task, dat):
"calculation of the percentage of completion of the task for use in the visualization of the Simulation"
tasks = self.taskData
start = tasks[task][2]
finish = tasks[task][3]
totalDays = tasks[task][4]
if dat < start:
self.percentConclTask = 100
elif dat > finish:
self.percentConclTask = 0
else:
concl = dat-start
concl= concl.days
self.percentConclTask = int((1-(concl / totalDays))*100)
return self.percentConclTask
def execute():
#for teste in FreeCad
filename = QtGui.QFileDialog.getOpenFileName(QtGui.qApp.activeWindow(),'Open file','*.xml')
file =filename[0]
#for test in IDLE Python, copy file to the same directory
#file = 'teste1.xml'
teste='2016-11-28T08:00:00'
dat = datetime.strptime(teste, '%Y-%m-%dT%H:%M:%S').date()
print (dat)
plan = PlannerData(str(file))
i = plan.getXmlData()
print (i)
for o in i:
p= plan.calcPercentConclTask( o, dat)
print ("id:%s transparency: %d" %(o, p ))
execute()
- Attachments
-
- project.JPG (107.75 KiB) Viewed 2655 times
-
- Captura.JPG (50.39 KiB) Viewed 2655 times
-
- teste1.zip
- (3.04 KiB) Downloaded 85 times
Re: Macro for BIM simulation of work
Yes that's a good idea... The thing is how to do that the clever way. There are a lot of standards to represent time ( https://en.wikipedia.org/wiki/Timestamp ) but a simple integer can be used to store a time stamp.bernd wrote:@Yorik and other developer: Do we have a property which represents a time in words a date and or a time? Would be cool to have such property type for the stuff walpa would like to do. AFAIK we do not have such property type.
also, we might need something different than just timestamps, more like time spans. So this could evolve into something bigger, where your objects "belong" to a certain phase, etc...
Maybe the construction phase needs to be like a material? An external object?
I think it has, don't remember exactly what, but I've seen something about construction phases in the docs.saso wrote:First thing to check would IMO be to check if maybe IFC has support for this?
In any case this all goes into the same direction: We should look at what/how others do and build a plan...
Re: Macro for BIM simulation of work
Your code can run with python 2.7
But change line 102 to
OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.8975 (Git)
Build type: Release
Branch: master
Hash: 3e06d0a09077ea0e719ae1970cfbe6426ea87fa1
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.0.0
But change line 102 to
reslut will show on "Report view"Msg ("id:%s transparency: %d\n" %(o, p ))
OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.8975 (Git)
Build type: Release
Branch: master
Hash: 3e06d0a09077ea0e719ae1970cfbe6426ea87fa1
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.0.0