Hello.
Is it possible to find and use the featurelines which are automatically created by a grading?
Theoretically the “gradingline 1” is in the same site as the “feaureline 1”, according to the properties.
Hi
If you attach an example drawing and file .dyn , that would be better
Hi.
Here are the files.
Export_Gradingline.dwg (2.5 MB)
Export_Gradingline.dyn (26.2 KB)
And i don’t want to find the featureline by the name.
The name can vary from project to project.
Hi
You can get featureline from here
May this help you?
"""
Copyright 2019 Autodesk, Inc. All rights reserved.
This file is part of the Civil 3D Python Module.
"""
__author__ = 'Paolo Emilio Serra - paolo.serra@autodesk.com'
__copyright__ = '2019'
__version__ = '1.0.0'
import clr
# Add Assemblies for AutoCAD and Civil 3D APIs
clr.AddReference('acmgd')
clr.AddReference('acdbmgd')
clr.AddReference('accoremgd')
clr.AddReference('AecBaseMgd')
clr.AddReference('AecPropDataMgd')
clr.AddReference('AeccDbMgd')
clr.AddReference('AeccPressurePipesMgd')
clr.AddReference('acdbmgdbrep')
clr.AddReference('System.Windows.Forms')
clr.AddReference('ProtoGeometry')
# Add standard Python references
import sys
sys.path.append('C:\Program Files (x86)\IronPython 2.7\Lib')
import os
import math
# Add references to manage arrays, collections and interact with the user
from System import *
from System.IO import *
from System.Collections.Specialized import *
from System.Windows.Forms import MessageBox
# Create an alias to the Autodesk.AutoCAD.ApplicationServices.Application class
import Autodesk.AutoCAD.ApplicationServices.Application as acapp
# Import references from AutoCAD
from Autodesk.AutoCAD.Runtime import *
from Autodesk.AutoCAD.ApplicationServices import *
from Autodesk.AutoCAD.EditorInput import *
from Autodesk.AutoCAD.DatabaseServices import *
from Autodesk.AutoCAD.Geometry import *
# Import references for PropertySets
from Autodesk.Aec.PropertyData import *
from Autodesk.Aec.PropertyData.DatabaseServices import *
# Import references for Civil 3D
from Autodesk.Civil.ApplicationServices import *
from Autodesk.Civil.DatabaseServices import *
from Autodesk.Civil import FeatureLinePointType
# Import Dynamo Geometry reference
import Autodesk.DesignScript.Geometry as DS
adoc = acapp.DocumentManager.MdiActiveDocument
cdoc = CivilApplication.ActiveDocument
ed = adoc.Editor
def get_featurelines():
"""
Extract the Land Feature Lines in the document and converst them into Dynamo PolyCurves
:returns: Dynamo PolyCurves
"""
global adoc
global cdoc
output = []
with adoc.LockDocument():
with adoc.Database as db:
with db.TransactionManager.StartTransaction() as t:
bt = t.GetObject(db.BlockTableId, OpenMode.ForWrite)
btr = t.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForWrite)
fls = []
for oid in btr:
fl = t.GetObject(oid, OpenMode.ForRead)
if isinstance(fl, FeatureLine):
#flsid = t.GetObject(fl.SiteId, OpenMode.ForRead)
fls.append([fl.Name,fl]) #(fl.Name) SiteId
return fls
OUT = get_featurelines()
This works perfect.
One last question:
Do you know if it is possible to set the featurelines, which are automatically created by the grading, to be named automatically? So i can filter the List with a content…
Object 2 and 3 are also featurelines from the grading. I renamed object 1 myself.
I can’t find a setting that works.
I was looking for a default setting in Civil3D, not in dynamo.
Search in setting
May picture help you
I think you have the wrong setting… Yours is for corridors.
I have changed every featureline-name in the grading settings, but still no name
Yes, my picture is just an example
How do you make up the grading manually Or by programming?
Can you ask a question, which is better for naming?
Reading this