Hi Everyone , Am struggling in profile PVIs, I have 2 specific stations i need all stations between them have the same level including start station and end station (St.1 & St.2).
As example that has the same idea we can do this case in the feature line by selecting some stations from elevation editor and set elevation constant or constant grade.
How can i set same elevation for all stations are in-between specific 2 stations?!
Appreciate if someone help me. Ex_Profile__PVI.dwg (953.5 KB) Ex_Profile__PVI.dyn (60.3 KB)
Thanks , but my concern is not creating new profile
my Question how can i modify elevations in-between 2 stations and set same elevation automatically in same existing profile.
As example in your dyn here how to select from index 1 to 4 and set same elevation or grade
No - this is the forum for all things Dynamo. Part of the problem is your timing - you asked on a Friday when many are out due to holidays, and as a result we have less time to spare on forum topics.
This is compounded by the lack of relevant files which prevents many community members like myself can’t currently help (not that I have much time to do so lately) due to the lack of sample files (DWG and DYN to start with). With out those the ask is to make something like what your base condition is via the UI or API or Dynamo, followed by actually getting to the code - basically doubling or tripling the level of effort required. That said even with files the community members who could solve this for you might not have time to do so, and as such it’s best to put a bit of work in on your own.
Towards that end searching the forum can get you started pretty quickly - I found this thread that I think gives you a path forward when searching “PVI update”: Profile PVI Update/Remove - #12 by hosneyalaa
After you make a few tries with methods like that update this thread with your progress including files and any code samples you write as there could be a quick fixes which skilled community members find to resolve the issue for you.
If that still doesn’t work you could try asking in a Civil 3D API forum for the API method to edit the elevation of a PVI - if such doesn’t exist then unfortunately Dynamo won’t be able to help you as it’s limited by the API.
Thank you for responding.
I must admit, I was not satisfied with the way you replied.
Before posting anything, I thoroughly research my questions multiple times.
Although I came across the link you shared earlier, the title did not seem relevant to the content, hence it did not address my query.
I did not post in search of someone to create a dynamo for me, as I have already made some progress, as evident from my screenshots. I shared the post seeking a small idea or instructions to help me complete the task, assuming this forum serves that purpose.
Just so you know, I have previously uploaded Dynamos and dwgs multiple times for various purposes, but received no active responses. I do not hold anyone accountable, but I believe this forum should guide and support individuals at all levels - be it beginners, intermediates, or professionals. If this forum does not align with our expectations, perhaps we should refrain from using it in the future.
Thank you.
The forum does try to guide and and help users of all abilities, which is what I was attempting to facilitate in response to your post about any “kind of help about the topic”.
my reasoning is that for someone like me to help by writing custom code (seems a necessity here) we need sample data. Others who are on this thread and in the forum might be able to do this quickly as they are familiar with this aspect of civil 3D, but for the majority of users here that is a time consuming task.
I know your posts, am glad you have contributed to the community, and respect that you often do post data sets and progress work. Many of your threads have solutions based on the data sets provided or the question which was asked, and of the ones which don’t there usually has been a need to write custom code to accomplish the task - which is no small effort on the part of the community members who aim to help. The added effort of a data set or starting code template is often the ‘hour too much’ for the time we have to spare.
While I can’t make any promises of a viable solution I will take a look at getting a code sample to do the task above, but I can likely only get viable progress with a simple dataset and your graph to this point (with inputs edited to the simple data set). Short of that the hour I may have will be eaten up trying to get suitable set of PVIs into Civil 3D.
Yes , it should be by API. update existing or remove PVIs
It’s limited by dynamo nodes .
**Because dynamo didn’t apply to set the same station with another level, just need to input differ station ** Every time gave me null value.
Not at the CPU with C3D installed to check right now but if you give it a list of profiles, an list of lists of indexes, a list of lists of stations, and a list of lists of elevations this may work:
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 , nn , ss , ee):
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.ForWrite)
objpv = obj.PVIs
indexpv =objpv[int(nn)]
pvee = indexpv.Elevation
indexpv.Elevation = pvee + ee
pvss = indexpv.Station
indexpv.Station = ss + pvss
output.append([ pvss , pvee ])
t.Commit()
return output
#### new code here ####
profiles = IN[0]
indexesLists = IN[1]
stationsLists = IN[2]
elevationsLists = IN[3]
OUT = []
for profile, indexes, stations, elevations in zip(profiles, indexesLists, stationsLists, elevationsLists):
adjustments = [get_sample_line_info(profile, indx, station, elevation) for indx,station,elevation in zip(indexes, stations, elevations) ]
OUT.append(adjustments)