Showing posts with label Civil 3D. Show all posts
Showing posts with label Civil 3D. Show all posts

Saturday, July 08, 2017

Phần mềm Nhập số liệu khảo sát vào Civil 3D


Tính năng của phần mềm

Nhập số lieu khảo sát theo tim tuyến

Phần mềm cho phép rải số lieu khảo sát dọc theo tim tuyến đã có trên Civil 3D. Các định dạng file khảo sát được hỗ trợ bao gồm:
NTD
TEDI
Các định dạng khảo sát khác sẽ được cập nhật trong các phiên bản kế tiếp.

Hướng dẫn sử dung


Phiên bản

1.0.0: Phiên bản đầu tiên

Liên hệ

Nếu có vấn đề trong quá trình sử dung, vui long liên hệ email: hoang.tt@hotmail.com.


Thursday, December 29, 2011

Use COM Interoperability with .NET


Limitations and Using Interop (COM)
The .NET API does not expose all the functionality of AutoCAD Civil 3D, and it exposes less than the COM API. The following areas are not yet exposed in .NET:

  • Survey
  • Points
  • Surfaces
  • Sites and Parcels
  • Sections
  • Data Bands
  • Labels (except Alignment, Profile and Profile View labels)
In addition, there are some areas in implemented functionality that are not yet complete:

  • Pipes: interference checks (except interference check styles)
  • Corridors:
    • creating new corridors
    • adding baselines to corridors
    • creating or modifying corridor boundaries or masks
    • creating featurelines from polylines
    • computing cut and fill
    • setting the CodeSetStyle
If you require this functionality in your .NET project, you can use the corresponding COM objects.

To use AutoCAD Civil 3D COM APIs from .NET
  1. Create a .NET solution and project.
  2. Select Add Reference from the Project menu or Solution Explorer.
  3. On the COM tab, select the AutoCAD 2011 Type Library and the AutoCAD/ObjectDBX Common 18.0 Type Library.
  4. On the COM tab, selec the AEC Base 6.5 Application Library and the AEC Base 6.5 Object Library.
  5. On the COM tab, select the required Autodesk Civil Engineering 8.0 libraries for the functionality you require (for example, Land and UI Land for Alignments).
  6. Add the Autodesk.AutoCAD.Interop and Autodesk.AECC.Interop.Ui namespaces to your using or Imports statement.
NoteYou may see warnings about types not being found in various Autodesk.AutoCAD.Interop namespaces (warning type 1684). To disable these warnings, enter 1684 under Supress Warnings on the Build tab of the project’s properties.

In case libraries are not showed in the COM tab, they can be loaded by corresponding tlb files:

  • The AutoCAD 2010 type library, acax18enu.tlb, located at :\Program Files\Common Files\Autodesk Shared.
  • The AutoCAD/ObjectDBX Common 18.0 type library, axdb18enu.tlb, located at :\Program Files\Common Files\Autodesk Shared.
  • Autodesk Civil Engineering 8.0 libraries (for example, Land and UI Land), located at :\Program Files\Common Files\Autodesk Shared\Civil Engineering 80\Aecc*.tlb

Thursday, January 27, 2011

Optimizing the loading of AutoCAD .NET applications

Optimizing the loading of AutoCAD .NET applications
http://through-the-interface.typepad.com/through_the_interface/2006/09/optimizing_the_.html

Automatic loading of .NET modules
http://through-the-interface.typepad.com/through_the_interface/2006/09/automatic_loadi.html

Sunday, November 21, 2010

Tạo Windows Form trong AutoCAD .Net

Showing a splash-screen from your AutoCAD .NET application

(http://through-the-interface.typepad.com/through_the_interface/2007/06/showing_a_splas.html)

Thanks once again to Viru Aithal for the inspiration behind this post, although I did write most of the code, this time. :-)
Adding a splash screen can give a touch of class to your application, assuming it's done non-intrusively. This post focuses on how best to do so within AutoCAD, and use the time it's displayed to perform initialization for your application.
The first thing you need to do is add a Windows Form to your project:
Splash_screen_1
You should select the standard "Windows Form" type, giving an appropriate name (in this case I've used "SplashScreen", imaginatively enough).
Splash_screen_2
Once this is done, you should set the background for the form to be your preferred bitmap image, by browsing to it from the form's BackgroundImage property:
Splash_screen_3
Now we're ready to add some code. Here's some C# code that shows how to show the splash-screen from the Initialize() method:

using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.ApplicationServices;
using Prompts; // This is the name of the module

namespace SplashScreenTest
{
  public class Startup : IExtensionApplication
  {
    public void Initialize()
    {
      SplashScreen ss = new SplashScreen();

      // Rather than trusting these properties to be set
      // at design-time, let's set them here
      ss.StartPosition =
        System.Windows.Forms.FormStartPosition.CenterScreen;
      ss.FormBorderStyle =
        System.Windows.Forms.FormBorderStyle.None;
      ss.Opacity = 0.8;
      ss.TopMost = true;
      ss.ShowInTaskbar = false;

      // Now let's disply the splash-screen
      Application.ShowModelessDialog(
        Application.MainWindow,
        ss,
        false
      );
      ss.Update();

      // This is where your application should initialise,
      // but in our case let's take a 3-second nap
      System.Threading.Thread.Sleep(3000);

      ss.Close();
    }
    public void Terminate()
    {
    }
  }
}
Some notes on the code:
  • I used a sample application called "Prompts" - you should change the using directive to refer to your own module name.
  • We're setting a number of properties dynamically (at runtime), rather than stepping through how to set them at design-time.
  • We've set the splash screen to be 80% opaque (or 20% transparent). This is easy to adjust.
  • Some of the additional properties may be redundant, but they seemed sensible to set (at least to me).
Here's the result... I've set up my application to demand-load when I invoke a command, which allowed me to load a DWG first to show off the transparency of the splash-screen (even though the above code doesn't actually define a command - so do expect an "Unknown command" message, if you do exactly the same thing as I have). You may prefer to set the module to load on AutoCAD startup, otherwise.
Splash_screen_4

Update:
Roland Feletic brought it to my attention that this post needed updating for AutoCAD 2010. Thanks, Roland!
I looked into the code, and found that the call to ShowModelessDialog needed changing to this:
      Application.ShowModelessDialog(
        Application.MainWindow.Handle,
        ss,
        false
      );
I also found I had to add an additional assembly reference to PresentationCore (a .NET Framework 3.0 assembly).

Friday, October 22, 2010

Tài liệu về Civil 3D - Documents about Civil 3D

(Sẽ được cập nhật liên tục - Will be updated regularly)

Tuesday, October 12, 2010

Import Styles and Settings trong Civil 3D 2011

Trong Civil 3D 2011, khi muốn sử dụng các styles và setting từ những file đã có sẵn, sử dụng:
  • Để import các styles: dùng lệnh AeccImportStyles
  • Để import các styles và settings: dùng lệnh AeccImportStylesAndSettings
 Tham khảo: http://civil3dguru.blogspot.com/2010/06/undocumented-aec-style-commands-civil.html

Ý tưởng: tạo mô đun có chức năng:
  • Cho phép import các styles và settings bằng cách lựa chọn tệp nguồn; chọn các styles hoặc settings cần import; chọn cách thức import (ghi đè, bỏ qua, đổi tên...)

Mở rộng đường cong với C3D 2011

Mở rộng đường cong với Civil 3D 2011
  1. Khai báo trong file Design Standard với các chú ý sau:
    • Tạo mở rộng dạng tra bảng: Nhập số làn xe, chiều rộng ứng với số làn xe đó (VD 2 làn [x3.5m], tổng là 7.0m)
    • Tạo bảng độ mở rộng theo: Vận tốc (các vận tốc đều có độ mở rộng như nhau theo TCVN); bán kính cong và độ mở rộng tương ứng (ứng với 2 làn xe)
  2. Tạo Alignment offset:
    • Nhớ chọn vào mục Add Widening
    • Chọn khoảng cách offset (giá trị này không hề ảnh hưởng đến độ mở rộng làn)
    • Chọn kiểu mở rộng (ở đây sẽ chọn theo file Design Standard)
    • Chú ý chọn đúng kiểu mở rộng, cách tính chiều dài chuyển tiếp (giá trị này lấy chính bằng đoạn nối siêu cao)
    • Chọn bề rộng tiêu chuẩn của làn. Do tiêu chuẩn thiết lập theo 3.5m nên bề rộng làn cũng chọn là 3.5m.
    • Chọn số làn bên trái và phải: nếu số làn bên trái (hoặc phải) lớn hơn 1 thì độ mở rộng sẽ được nhân lên tương ứng. Công thức độ mở rộng ở mỗi bên là:
      [số làn] * [độ mở rộng theo tiêu chuẩn] /2 * [số làn ở mỗi bên]

Sunday, October 03, 2010

Siêu cao trong Civil 3D - Superelevation Civil 3D

Cách 1:
Siêu cao trước hết sẽ được tính tự động trong file tiêu chuẩn thiết kế, dựa trên các thông số Bán kính cong, Chiều dài đường cong chuyển tiếp, Bảng siêu cao, Công thức tính siêu cao.
Lưu ý về công thức tính siêu cao: nên lập theo trình tự sau (ví dụ theo TCVN: đoạn siêu cao lấy trùng với đoạn chuyển tiếp và mở rộng):
  • transitionformula formula="{t}/({e}+{c})*{e}" type="LCtoFS"
  • transitionformula formula="{p}*{t}-{t}/({e}+{c})*{c}" type="LCtoBC"
  • transitionformula formula="{t}/({e}+{c})*{c}" type="NCtoLC"
  • transitionformula formula="{t}/({e}+{c})*{c}" type="LCtoRC"
  • transitionformula formula="{t}*({s}-{c})/({e}+{c})" type="NStoNC"


Cách 2: 
Import từ file CSV, cấu trúc file như sau (link):
  1. Curve number
  2. Station
  3. Critical station type
  4. Curve length
  5. Left Outside Shoulder
  6. Left Outside Lane
  7. Left Inside Lane
  8. Left Inside Shoulder
  9. Right Outside Shoulder
  10. Right Outside Lane
  11. Right Inside Lane
  12. Right Inside Shoulder
 Ý tưởng: có thể dựa trên file csv, lập mô đun tính toán lại siêu cao cho đơn giản hơn





Superelevation Specification Variables
Use the following set of variables to calculate transition distances.
{e} Độ dốc siêu cao. Phụ thuộc vào vận tốc và bán kính, tra theo bảng thiết kế.
The full superelevation rate. This rate is determined from the superelevation rate table, based on the design speed and curve radius.
{t} Đọc từ bảng chiều dài chuyển tiếp, dựa trên vận tốc và bán kính.
The value that is read from the transition length tables, based on the design speed and the curve radius. This value may not be an actual length, but some other value, such as a transition rate from which the length can be calculated.
{c} Độ dốc mặt đường thông thường.
The unsuperelevated normal lane slope (positive). This value is defined by the user in the Superelevation Properties dialog box.
{s} Độ dốc lề đường thông thường.
The unsuperelevated normal shoulder slope (positive). This value is defined by the user in the Superelevation Properties dialog box.
{w} Bề rộng từ điểm quay đến mép ngoài quay siêu cao.
The nominal width from the pivot point to the outermost edge-of-traveled way. This value is defined by the user in the Superelevation Properties dialog box.
{l} Chiều dài của đường cong chuyển tiếp.
The length of the spiral, if a spiral is involved in the transition. This is the actual length of the spiral element in the curve group.
{p}The fractional part of the transition length before the start of the curve or after the end of the curve.
{q}The rate of increase of centripetal acceleration traveling along a curve at a constant speed.
{v}

The variables in the previous table are used to calculate the following distances:
NCtoLC Normal Crown point to Level Crown point (runout)
LCtoFS Level Crown point to Full Super point (runoff)
LCtoRC Level Crown point to Reverse Crown point
LCtoBC Level Crown point to Beginning of Curve
NCtoFS Normal Crown point to Full Super point (used instead of LCtoFS on undivided planar roads) for example the length of the superelevation transition
NCtoBC Normal Crown point to Beginning of Curve (used instead of LCtoBC on undivided planar roads)
NStoNC Normal Shoulder point to Normal Crown point (used for the Breakover Removal Method of superelevated shoulders)

Use this section to view examples of the XML formats you can use for various superelevation attainment methods.

Standard Attainment Method Example
The following example shows the XML format you can use to calculate transition stations for undivided, crowned roadways using the AASHTO standard methodology:
 
 
 
 
 
This example defines an attainment method whose name is "AASHTO 2001 - Crowned Roadway" which uses the standard adverse crown removal method of attaining superelevation. This example includes a calculation for the transition distance needed for shoulder breakover removal (type="NStoNC").

Planar Transition Attainment Method Example
This example shows an undivided planar road. The roadway is not crowned, and there is no adverse crown removal.
The Planar attainment method requires two formulas: one for curves that oppose the direction of the normal cross slope and one for curves that continue in the direction of the normal cross-slope. The following illustration shows normalized slope superelevation, where the unsuperelevated road is tilted downward from left to right. Therefore the curve to the left requires a longer transition than the curve to the right:

In the following example, the Continuing section defines the Normal Crown to Full Superelevation distance runoff length {t} (derived from the transition length tables), minus the runoff length times the normal roadway slope {c} divided by the full superelevation rate {e}. The second formula defines the distance from Normal Crown to the Beginning of Curve as a percentage of {t} based on the variable {p} minus {c} divided by {e}.
The Opposing section defines the overall transition distance to be the runoff length {t}. The distance to the Beginning of Curve is a percentage of {t} based on the variable {p}, and the distance between the Normal Crown and Level Crown stations is {t} * {c} / {e}.

Transitions Defined by Roadway Width and Transition Rate
Not all organizations use tables that give transition length directly. The following table defines the full superelevation rate and the as a function of design speed and curve radius. In this situation, the value is used to derive the transition length based on the normal width of the roadway. The Transition Length tables define the value instead of the actual transition length.

Radius (m) 90 km/h 100km/h 110km/h 120km/h

E% E% E% E% n/a
7000 NC n/a NC n/a NC n/a NC n/a
5000 NC n/a NC n/a NC n/a 2.0 0.31
3000 2.0 0.39 2.0 0.34 2.0 0.32 2.0 0.31
2500 2.0 0.39 2.0 0.34 2.0 0.32 2.0 0.31
2000 2.0 0.39 2.0 0.34 2.0 0.32 2.3 0.32
1500 2.0 0.39 2.0 0.34 2.2 0.33 3.0 0.33
1400 2.0 0.39 2.0 0.34 2.4 0.33 3.2 0.34
1300 2.0 0.39 2.0 0.34 2.6 0.33 3.5 0.34
1200 2.0 0.39 2.2 0.35 2.8 0.34 3.8 0.35
1000 2.0 0.39 2.6 0.36 3.7 0.35 4.5 0.37
900 2.2 0.40 2.9 0.37 3.7 0.36 5.0 0.38
800 2.5 0.40 3.3 0.38 4.2 0.38 5.7 0.39
700 2.9 0.41 3.7 0.39 4.8 0.39 6.0 0.40
600 3.4 0.42 4.4 0.41 5.6 0.41

500 4.0 0.44 5.2 0.43 6.0 0.42

400 5.0 0.46 6.0 0.45



300 6.0 0.48





The following example shows attainment methods and formulas for two types of roadways based on the previous table. The variable {w} is the normal roadway width from pivot point to edge-of traveled-way, defined in the Superelevation wizard.

Saturday, October 02, 2010

Import points: Station-Offset-Elev

Import points: Station-Offset-Elev

Creates points along an alignment by importing points from an ASCII (text) file that contains station, offset, and elevation information.

The file you import can contain the station, offset, elevation, and description of each point. The elevation can be expressed as either a single value (elevation) or a rod reading with instrument height (rod, hi).

ASCII (text) files that use the following layouts (formats) can be imported:

  • Station, Offset
  • Station, Offset, Elevation
  • Station, Offset, Rod, Hi
  • Station, Offset, Description
  • Station, Offset, Elevation, Description
  • Station, Offset, Rod, Hi, Description

Use commas or spaces as delimiters (separators) in the file. Include one or more comment lines in the file by putting a semi-colon (;) or a pound sign (#) in the first column of a comment line.

The following is an example of data in an ASCII (text) file that is formatted using the Station, Offset, Elevation format:

#station, offset, elevation: subdivision 1
0 20.0 112.00
10 23.5 114.64
20 22.5 116.56
30 23.0 116.32
40 22.0 115.83

The first line in this example is a comment line that is ignored when the points are imported. Each of the remaining lines contains the station, offset, and elevation for a point. The file is delimited by spaces.

Before you import the file, you are prompted to describe the format of the ASCII (text) file. You can also be prompted to specify invalid indicator values for station/offsets, elevations, and rod heights.

Point settings, styles, layers, point groups, and description keys can all affect how a point is created or how it is displayed in the drawing. For more information, see Before You Create Points.

Ý tưởng: tạo module cho phép

  • Chuyển đổi giữa các loại file số liệu
  • Chọn file chứa trắc ngang (TDN, PRN, Station-Offset-Elev.)
  • Chọn alignment
  • Chọn vùng cần import dữ liệu (from Sta -> Sta)
  • Import các điểm, tạo Point group nếu cần
  • Tạo các Sample Line tại các trắc ngang có số liệu