Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash report from Dynamo 3.2.1.5366 #15611

Open
esmarezan opened this issue Nov 6, 2024 · 2 comments
Open

Crash report from Dynamo 3.2.1.5366 #15611

esmarezan opened this issue Nov 6, 2024 · 2 comments
Labels

Comments

@esmarezan
Copy link

esmarezan commented Nov 6, 2024

Dynamo Version

3.2.1.5366

Host

No response

Operating System

Microsoft Windows NT 10.0.22631.0

What did you do?

I wrote a basic python script tgo run but everytime I try to run some scripts. Program crashes

What did you expect to see?

To be able to run the scripts
import clr
clr.AddReference("RevitServices")
clr.AddReference("RevitAPI")
clr.AddReference("RevitAPIUI")
from RevitServices.Persistence import DocumentManager
from Autodesk.Revit.DB import FilteredElementCollector, FamilyInstance, FamilySymbol, XYZ, Transaction
import csv

Revit document

doc = DocumentManager.Instance.CurrentDBDocument

Giriş verileri

file_path = IN[0] # CSV dosya yolu
family_type_id = IN[1] # Family Type ID

CSV dosyasını okuyup son satırdaki x, y, z verilerini alıyoruz

with open(file_path, 'r') as csvfile:
reader = csv.reader(csvfile)
rows = list(reader)

# Eğer dosya boşsa veya yeterli veri yoksa hata vermeden çık
if len(rows) < 2:  # 1 satır başlık satırı olduğu varsayılıyor
    OUT = "CSV dosyasında yeterli veri yok."
else:
    last_row = rows[-1]
    
    # Veri kontrolü yapalım
    if len(last_row) < 4:  # Zaman, x, y, z sütunlarının mevcut olup olmadığını kontrol eder
        OUT = "Son satırda eksik veri var."
    else:
        timestamp = last_row[0]  # Zaman verisi
        x, y, z = map(float, last_row[1:4])  # X, Y, Z koordinatları

        # Yeni XYZ konum noktası
        point = XYZ(x, y, z)

        # Mevcut tüm küp componentlerini (aynı family türünden olanları) buluyoruz
        family_instances = FilteredElementCollector(doc).OfClass(FamilyInstance).OfCategoryId(doc.GetElement(family_type_id).Category.Id).ToElements()

        # Önceki küpleri silme işlemi
        t = Transaction(doc, "Delete Previous Cube")
        t.Start()
        for instance in family_instances:
            doc.Delete(instance.Id)
        t.Commit()

        # Yeni küpü belirtilen noktaya yerleştiriyoruz
        symbol = doc.GetElement(family_type_id)
        if not symbol.IsActive:
            t = Transaction(doc, "Activate Family Symbol")
            t.Start()
            symbol.Activate()
            t.Commit()

        # Yeni bir Transaction başlatarak küp componenti ekleme
        t = Transaction(doc, "Place Cube at New Location")
        t.Start()
        new_instance = doc.Create.NewFamilyInstance(point, symbol, Autodesk.Revit.DB.Structure.StructuralType.NonStructural)
        t.Commit()

        # Çıktı olarak yeni instance döndürülür
        OUT = new_instance

What did you see instead?

Infinite running dynamo script

What packages or external references (if any) were used?

No response

Stack Trace

No response

Details

CLR: 8.0.0

Copy link

github-actions bot commented Nov 6, 2024

Thank you for submitting the issue to us. We are sorry to see you get stuck with your workflow. While waiting for our team member to respond, please feel free to browse our forum at https://forum.dynamobim.com/ for more Dynamo related information.

@avidit avidit added the tracked label Nov 6, 2024 — with Slack
@dynamo-ci-user dynamo-ci-user moved this from Triage to Todo in Dynamo Issues Nov 6, 2024
Copy link
Contributor

avidit commented Nov 6, 2024

tracked internally DYN-7741

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Todo
Development

No branches or pull requests

2 participants