자유 게시판

제목dcdcs2024-03-11 15:35
작성자
첨부파일ImprovedGarrisons.zip (164.3KB)MyLittleWarband.zip (34.3KB)

// 필요한 네임스페이스 추가

using Autodesk.Revit.DB;

using Autodesk.Revit.UI;


public XYZ GetLevelOriginPoint(Document doc, ElementId levelId)

{

    // 레벨 가져오기

    Level level = doc.GetElement(levelId) as Level;


    if (level != null)

    {

        // BasePoint 가져오기

        Element basePointElement = doc.GetElement(level.GetDependentElements(new ElementClassFilter(typeof(BasePoint))).FirstOrDefault());


        if (basePointElement != null)

        {

            LocationPoint locationPoint = basePointElement.Location as LocationPoint;


            if (locationPoint != null)

            {

                // 레벨의 원점 가져오기

                XYZ levelOrigin = locationPoint.Point;


                TaskDialog.Show("Level Origin", "Level Origin Point: " + levelOrigin.ToString());

                return levelOrigin;

            }

            else

            {

                TaskDialog.Show("Error", "Unable to get LocationPoint from BasePoint.");

            }

        }

        else

        {

            TaskDialog.Show("Error", "BasePoint not found for the given Level.");

        }

    }

    else

    {

        TaskDialog.Show("Error", "Level not found with the given ID.");

    }


    return null;

}


댓글

(자동등록방지 숫자를 입력해 주세요)
이전조브락스의 유산2024-03-14
-dcdcs2024-03-11
다음frfff2024-02-06