Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Here's my code to create a new drawing from .Net code
[CommandMethod(nameof(CreateNewDrawing))]
public void CreateNewDrawing()
{
var fileName = @"E:\Sample Project\February 2025\EmptyDrawing.dwg";
using var db = new Database(true, true);
db.SaveAs(fileName, DwgVersion.Current);
}
I need to stress that the correct file, EmptyDrawing.dwg is created at the designated location. But when I open it, and compare it with a new drawing I create via UI, there are critical difference, in that the (Civil 3D) styles are missing.
Here are the two screenshot ( the first screenshot is for the drawing created via .Net API, the second screenshot is the drawing created via UI) that compare them:
I'm pretty sure I don't create the drawing properly via code, any command that I miss?
##########
Ngu Soon Hui
##########
I'm the Benevolent Dictator for Life for MiTS Software. Read more here
I also setup Civil WHIZ in order to share what I learnt about Civil 3D
Ngu Soon Hui
##########
I'm the Benevolent Dictator for Life for MiTS Software. Read more here
I also setup Civil WHIZ in order to share what I learnt about Civil 3D
Solved! Go to Solution.