Profile Curves Length

hi @hosneyalaa
does not give correct result in every way
Unfortunately…

i need a vertical curve

can you attach
An example drawing with the result you want
I have to try

If so, could you post the question in a new thread?

hi @hosneyalaa

VerticalCurve İs Needed

3-

Drawing1.dwg (2.3 MB)

PLS
attach A result you want

4

Definitely think you should do a different thread for this subject as you are now on the Civil 3D Toolkit feedback thread. It will help get more attention to your specific issue/workflow/problem as well as help others when searching and will keep the Civil 3D Toolkit feedback for Civil 3D Toolkit’s issues

1 Like

ok @david_licona

Moved to a new thread

2 Likes

Ok thanks @Paolo_Emilio_Serra1

try

import sys
import clr

clr.AddReference('AcMgd')
clr.AddReference('AcDbMgd')
clr.AddReference('AeccDbMgd')
#clr.AddReference('ProtoGeometry')
import clr
clr.AddReference('ProtoGeometry')
import Autodesk.DesignScript.Geometry
from Autodesk.DesignScript.Geometry import *

clr.AddReference('DSCoreNodes')
from DSCore import *

from Autodesk.AutoCAD.ApplicationServices import *
from Autodesk.AutoCAD.DatabaseServices import *
from Autodesk.AutoCAD.Geometry import *

from Autodesk.Civil.ApplicationServices import *
from Autodesk.Civil.DatabaseServices import *

from System.Collections.Generic import Dictionary

adoc = Application.DocumentManager.MdiActiveDocument
cdoc = CivilApplication.ActiveDocument




def get_sample_line_info(sampleLines):
	
	global adoc
	global cdoc
	
	output = []
	

	if not sampleLines:
		return
	
	if not isinstance(sampleLines, list):
		sampleLines = [sampleLines]

	with adoc.LockDocument():
	    with adoc.Database as db:
	        with db.TransactionManager.StartTransaction() as t:
				for sampleLine in sampleLines:	
					sampleLineId = sampleLine.InternalObjectId
					obj = t.GetObject(sampleLineId, OpenMode.ForRead)
					objpv = obj.PVIs
					for saPVI in objpv:
					    VerticalC= saPVI.VerticalCurve
					    if VerticalC:
					       output.append( str(saPVI.Station) + " "+ str(saPVI.Elevation) +" "+  str(VerticalC.Length))
					    else:
					         output.append( str(saPVI.Station) +" "+  str(saPVI.Elevation) +" "+ " " )
					outputFlatten =List.Flatten(output, -1)
		
				t.Commit()
	return output 		

OUT = get_sample_line_info(IN[0])

2 Likes

Ckohran Akhi …
it’s work …

1 Like

Salamun Aleykoum @hosneyalaa
Can we do it for multiple profiles ?

PROFIL PVI EXPORT MULTIPLE-1.dyn (89.2 KB)

WA Aleykoum Salamun

TRY

import sys
import clr

clr.AddReference('AcMgd')
clr.AddReference('AcDbMgd')
clr.AddReference('AeccDbMgd')
#clr.AddReference('ProtoGeometry')
import clr
clr.AddReference('ProtoGeometry')
import Autodesk.DesignScript.Geometry
from Autodesk.DesignScript.Geometry import *

clr.AddReference('DSCoreNodes')
from DSCore import *

from Autodesk.AutoCAD.ApplicationServices import *
from Autodesk.AutoCAD.DatabaseServices import *
from Autodesk.AutoCAD.Geometry import *

from Autodesk.Civil.ApplicationServices import *
from Autodesk.Civil.DatabaseServices import *

from System.Collections.Generic import Dictionary

adoc = Application.DocumentManager.MdiActiveDocument
cdoc = CivilApplication.ActiveDocument




def get_sample_line_info(sampleLines):
	
	global adoc
	global cdoc
	
	output = []
	

	if not sampleLines:
		return
	
	if not isinstance(sampleLines, list):
		sampleLines = [sampleLines]

	with adoc.LockDocument():
	    with adoc.Database as db:
	        with db.TransactionManager.StartTransaction() as t:
				for sampleLine in sampleLines:	
					sampleLineId = sampleLine.InternalObjectId
					obj = t.GetObject(sampleLineId, OpenMode.ForRead)
					objpv = obj.PVIs
					for saPVI in objpv:
					    VerticalC= saPVI.VerticalCurve
					    if VerticalC:
					       output.append( str(saPVI.Station) + " "+ str(saPVI.Elevation) +" "+  str(VerticalC.Length))
					    else:
					         output.append( str(saPVI.Station) +" "+  str(saPVI.Elevation) +" "+ " " )
					outputFlatten =List.Flatten(output, -1)
		
				t.Commit()
	return output 		

#OUT = get_sample_line_info(IN[0])

iPROFILES = IN[0]

OUTq =[]
if iPROFILES != None:
  for iPROFILE in iPROFILES:
     OUTq.append(      get_sample_line_info(iPROFILE)    )
else:
    OUTq.append("NO DATA")




OUT = OUTq





Selamu Aleykoum @hosneyalaa
6

PVI_KIRMIZI_KOT_ALTIN_YOL_15-003.txt (2.6 KB)
PVI_KIRMIZI_KOT_ALTIN_YOL_15-003.txt (2.6 KB)
PVI_KIRMIZI_KOT_ALTIN_YOL_15-003.txt (2.6 KB)
PVI_KIRMIZI_KOT_ALTIN_YOL_15-002.txt (2.6 KB)
PVI_KIRMIZI_KOT_ALTIN_YOL_15-001.txt (2.6 KB)

TRY

import sys
import clr

clr.AddReference('AcMgd')
clr.AddReference('AcDbMgd')
clr.AddReference('AeccDbMgd')
#clr.AddReference('ProtoGeometry')
import clr
clr.AddReference('ProtoGeometry')
import Autodesk.DesignScript.Geometry
from Autodesk.DesignScript.Geometry import *

clr.AddReference('DSCoreNodes')
from DSCore import *

from Autodesk.AutoCAD.ApplicationServices import *
from Autodesk.AutoCAD.DatabaseServices import *
from Autodesk.AutoCAD.Geometry import *

from Autodesk.Civil.ApplicationServices import *
from Autodesk.Civil.DatabaseServices import *

from System.Collections.Generic import Dictionary

adoc = Application.DocumentManager.MdiActiveDocument
cdoc = CivilApplication.ActiveDocument




def get_sample_line_info(sampleLines):
	
	global adoc
	global cdoc
	
	output = []
	

	if not sampleLines:
		return
	
	if not isinstance(sampleLines, list):
		sampleLines = [sampleLines]

	with adoc.LockDocument():
	    with adoc.Database as db:
	        with db.TransactionManager.StartTransaction() as t:
				for sampleLine in sampleLines:	
					sampleLineId = sampleLine.InternalObjectId
					obj = t.GetObject(sampleLineId, OpenMode.ForRead)
					objal = t.GetObject(obj.AlignmentId, OpenMode.ForRead)
					objpv = obj.PVIs
					output.append( "Profile NAME" + " "+ str(obj.Name) + " &&& "+ "Public property	Alignment NAME" + " "+ str(objal.Name))
					#output.append( "station" + " "+ "elevation " +" "+  "curve length")
					output.append( "station" + " "+ "elevation" +" "+  "curve length")
					for saPVI in objpv:
					    VerticalC= saPVI.VerticalCurve
					    if VerticalC:
					       output.append( str(saPVI.Station) + " "+ str(saPVI.Elevation) +" "+  str(VerticalC.Length))
					    else:
					         output.append( str(saPVI.Station) +" "+  str(saPVI.Elevation) +" "+ " " )
					#outputFlatten =List.Flatten(output, -1)
					output.append( "")
					output.append( "")
					output.append( "")
		
				t.Commit()
	return output 		

#OUT = get_sample_line_info(IN[0])

iPROFILES = IN[0]

OUTq =[]
if iPROFILES != None:
  for iPROFILE in iPROFILES:
     OUTq.append(      get_sample_line_info(iPROFILE)    )
else:
    OUTq.append("NO DATA")




OUT = OUTq





1 Like

Chokran akhi @hosneyalaa

Working…

Hi @abdullahcicek
to export multi .CSV as you have

Hi @hosneyalaa
I set it exactly how I want it and it works fine.
Thank you brother for your contribution.

It would be better if the numbers were 3 digits after the decimal point.

PROFIL PVI EXPORT MULTIPLE.dyn (282.8 KB)

HI @abdullahcicek
TRY

Math.Round(saPVI.Station,3)  .....>>> The number 3 expresses the accuracy of others as you need
import sys
import clr

clr.AddReference('AcMgd')
clr.AddReference('AcDbMgd')
clr.AddReference('AeccDbMgd')
#clr.AddReference('ProtoGeometry')
import clr
clr.AddReference('ProtoGeometry')
import Autodesk.DesignScript.Geometry
from Autodesk.DesignScript.Geometry import *

clr.AddReference('DSCoreNodes')
from DSCore import *

from Autodesk.AutoCAD.ApplicationServices import *
from Autodesk.AutoCAD.DatabaseServices import *
from Autodesk.AutoCAD.Geometry import *

from Autodesk.Civil.ApplicationServices import *
from Autodesk.Civil.DatabaseServices import *

from System.Collections.Generic import Dictionary

adoc = Application.DocumentManager.MdiActiveDocument
cdoc = CivilApplication.ActiveDocument




def get_sample_line_info(sampleLines):
	
	global adoc
	global cdoc
	
	output = []
	

	if not sampleLines:
		return
	
	if not isinstance(sampleLines, list):
		sampleLines = [sampleLines]

	with adoc.LockDocument():
	    with adoc.Database as db:
	        with db.TransactionManager.StartTransaction() as t:
				for sampleLine in sampleLines:	
					sampleLineId = sampleLine.InternalObjectId
					obj = t.GetObject(sampleLineId, OpenMode.ForRead)
					objpv = obj.PVIs
					for saPVI in objpv:
					    VerticalC= saPVI.VerticalCurve
					    if VerticalC:
					       output.append( str(Math.Round(saPVI.Station,3) ) + " "+ str( Math.Round(saPVI.Elevation,3) ) +" "+  str(Math.Round( VerticalC.Length,3) )  )
					    else:
					         output.append( str( Math.Round( saPVI.Station , 3 )) +" "+  str( Math.Round( saPVI.Elevation , 3 ) ) +" "+ " " )
					#outputFlatten =List.Flatten(output,-1)
					output.append( "" )
					output.append( "" )
		
				t.Commit()
	return output 		

#OUT = get_sample_line_info(IN[0])

iPROFILES = IN[0]

OUTq =[]
if iPROFILES != None:
  for iPROFILE in iPROFILES:
     OUTq.append(      get_sample_line_info(iPROFILE)    )
else:
    OUTq.append("NO DATA")



OUT = OUTq





2 Likes

Choukran akhi @hosneyalaa