Community
Civil 3D Customization
Welcome to Autodesk’s AutoCAD Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D Customization topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

get default object name from template.

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
joantopo
609 Views, 4 Replies

get default object name from template.

Hi.

 

If I have this:

 

 ObjectId slgId = SampleLineGroup.Create("My SampleLineGroup", alignment.ObjectId);

 I don ´t want ask to user the sampleLineGroup name by prompt. I want to create a new sample line group which its name was default template name.

How can I do this?

 

 

Autocad C3D 2019 SP3, 2020 & 2021
Intel I9 9900K with frontal watercooler alphacool eisbaer 360 (original fans mounted in pull)- 3 fans Corsair 120 ML PRO in push.
MOBO Gygabyte Z390 Aorus Master- Corsair RGB Vengeance 64GB RAM (4x16) CL16
Nvidia Quadro RTX 4000
Samsung 970 EVO PLUS 1TB (unit C). Samsung 970 PRO 512GB (for data)
Power Supply: Corsair TX850M PLUS


Descubre mi programa VisorNET para Civil 3D:
https://apps.autodesk.com/CIV3D/es/Detail/Index?id=appstore.exchange.autodesk.com%3avisornet_windows32and64%3aes
4 REPLIES 4
Message 2 of 5
joantopo
in reply to: joantopo

Solved.

 

SettingsSampleLine.SettingsNameFormat Members

 

Autocad C3D 2019 SP3, 2020 & 2021
Intel I9 9900K with frontal watercooler alphacool eisbaer 360 (original fans mounted in pull)- 3 fans Corsair 120 ML PRO in push.
MOBO Gygabyte Z390 Aorus Master- Corsair RGB Vengeance 64GB RAM (4x16) CL16
Nvidia Quadro RTX 4000
Samsung 970 EVO PLUS 1TB (unit C). Samsung 970 PRO 512GB (for data)
Power Supply: Corsair TX850M PLUS


Descubre mi programa VisorNET para Civil 3D:
https://apps.autodesk.com/CIV3D/es/Detail/Index?id=appstore.exchange.autodesk.com%3avisornet_windows32and64%3aes
Message 3 of 5
joantopo
in reply to: joantopo

  Autodesk.Civil.ApplicationServices.CivilDocument civDoc = default(Autodesk.Civil.ApplicationServices.CivilDocument);
civDoc = Autodesk.Civil.ApplicationServices.CivilApplication.ActiveDocument; //obtener el documento de Civil


Autodesk.Civil.Settings.SettingsCmdCreateSampleLines comando = civDoc.Settings.GetSettings<Autodesk.Civil.Settings.SettingsCmdCreateSampleLines>() as Autodesk.Civil.Settings.SettingsCmdCreateSampleLines; string NombrePlantilla= comando.NameFormat.SampleLineGroup.Value;

 or:

 

Autodesk.Civil.Settings.SettingsSampleLine format = civDoc.Settings.GetSettings<Autodesk.Civil.Settings.SettingsSampleLine>() as Autodesk.Civil.Settings.SettingsSampleLine;

 

Autocad C3D 2019 SP3, 2020 & 2021
Intel I9 9900K with frontal watercooler alphacool eisbaer 360 (original fans mounted in pull)- 3 fans Corsair 120 ML PRO in push.
MOBO Gygabyte Z390 Aorus Master- Corsair RGB Vengeance 64GB RAM (4x16) CL16
Nvidia Quadro RTX 4000
Samsung 970 EVO PLUS 1TB (unit C). Samsung 970 PRO 512GB (for data)
Power Supply: Corsair TX850M PLUS


Descubre mi programa VisorNET para Civil 3D:
https://apps.autodesk.com/CIV3D/es/Detail/Index?id=appstore.exchange.autodesk.com%3avisornet_windows32and64%3aes
Message 4 of 5
david96007
in reply to: joantopo

//SettingsCmdCreateSampleLines.SettingsNameFormat nameFormat = // Autodesk.Civil.ApplicationServices.CivilApplication.ActiveDocument // .Settings.GetSettings().NameFormat; //string name = nameFormat.SampleLine.Value; 我得到的是:“采样线(<[下一个编号(CP)]>)”,是一个固定字符串,并不能实现自动编号。 I get this: "SampleLine (<[next counter (CP)]>)", it is a fixed string, it can not automatic numbering.
Message 5 of 5
AntoninVojtesekV
in reply to: joantopo

I would like to know how did you convert provided string to a name. Did you develop a custom function where you parse the string and create a new name? What about NextCounter? I could not find a way to get its current value from C3D API.

Technical Services Manager
Devotech Group of Companies
Devotech iDAS (Infrastructure Design Automation Suite)

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


 

Autodesk Design & Make Report