Hi.
I´m checking the civil 3D command "Create feature line from Alignment" but I have seen that the new feature line is an "automatic feature line" because it´s dynamic.
If I ask the user to select that feature line in the drawing:
_with1.AddAllowedClass(typeof(Autodesk.Civil.DatabaseServices.FeatureLine), true);
Then, my utility doesn´t recognize that object because it isn´t a FeatureLine object Type. What object Type is,then?
Moreover, the buttons "edit geometry" or "edit elevations" from feature line are disabled. I can revise table (stations and elevations).
I think those forms should be enabled only for read (not write) if we want to read any elevation points.
If we deactivate "dynamic link" option,then we can check "edit elevations" and the object is a simple feature line instead of automatic feature line but I don´t want to do this because after I won´t be able to convert it again in dynamic mode.
Perhaps, I would like to export "station and elevation" to ASCII file from that automatic feature line.
Thanks.
Solved! Go to Solution.
Solved by Jeff_M. Go to Solution.
@joantopo wrote:
Hi.
I´m checking the civil 3D command "Create feature line from Alignment" but I have seen that the new feature line is an "automatic feature line" because it´s dynamic.
If I ask the user to select that feature line in the drawing:
_with1.AddAllowedClass(typeof(Autodesk.Civil.DatabaseServices.FeatureLine), true);Then, my utility doesn´t recognize that object because it isn´t a FeatureLine object Type. What object Type is,then?
Thanks.
Change the "true" to false, then you can cast it as a Featureline. The "IsEditable" property will be false, but you will be able to get whatever data you need from it.
entOpts.AddAllowedClass(typeof(FeatureLine), false); PromptEntityResult entRes = ed.GetEntity(entOpts); if (entRes.Status != PromptStatus.OK) return; using (Transaction tr = HostApplicationServices.WorkingDatabase.TransactionManager.StartTransaction()) { FeatureLine fl = (FeatureLine)entRes.ObjectId.GetObject(OpenMode.ForRead); }
Of course the C3D .NET API doesn't support much for the featurelines so using the methods I previously showed for getting the COM properties by Reflection without COM being loaded will need to be revisited.
All right.
I have just finished my last command.
This is the results into a ASCII file to show data from automatic feature lines: (station elevation type(vertex or elevation point)
Thanks Jeff.
Can't find what you're looking for? Ask the community or share your knowledge.