AddSymbolAtPosition
Overloads
| Name | Description |
|---|---|
| AddSymbolAtPosition(string name, Vertex3D position, AnchorPoint anchor, Vertex3D rightDir, Vertex3D upDir, float scale) | 지정 이름의 Symbol 정의를 특정 월드 좌표에 (마우스 없이) 생성 배치. |
| AddSymbolAtPosition(string name, Vertex3D position, AnchorPoint anchor) | 지정 이름의 Symbol 정의를 특정 월드 좌표에 생성 배치 — 기본 방향(XY 평면, 무회전). |
| AddSymbolAtPosition(string name, Vertex3D position) | 지정 이름의 Symbol 정의를 특정 월드 좌표에 생성 배치 — position 이 심볼 중심(Center)에 오도록 기본 방향(XY 평면, 무회전)으로 배치. |
AddSymbolAtPosition(string name, Vertex3D position, AnchorPoint anchor, Vertex3D rightDir, Vertex3D upDir, float scale)
public int AddSymbolAtPosition(string name, Vertex3D position, AnchorPoint anchor, Vertex3D rightDir, Vertex3D upDir, float scale)
지정 이름의 Symbol 정의를 특정 월드 좌표에 (마우스 없이) 생성 배치.
Remarks
지정 AnchorPoint 가 position 에 오도록 정렬된다.
방향은 심볼의 오른쪽 방향(rightDir)과 위쪽 방향(upDir)을 지정하면 완전히 결정된다.
(평면 법선은 내부에서 rightDir × upDir 외적으로 계산됨)
Parameters
| Name | Type | Description |
|---|---|---|
| name | string | 로드된 Symbol 정의 이름 |
| position | Vertex3D | 배치 목표 월드 좌표 |
| anchor | AnchorPoint | position 에 맞출 기준 anchor |
| rightDir | Vertex3D | 심볼의 오른쪽 방향 단위벡터 (Global) |
| upDir | Vertex3D | 심볼의 위쪽 방향 단위벡터 (Global) |
| scale | float | 스케일 (기본 1.0) |
Returns
| Type | Description |
|---|---|
| int | 생성된 배치 Symbol 인덱스. 실패 시 -1. |
Examples
// VIZCore3D.NET Control
private VIZCore3D.NET.VIZCore3DControl vizcore3d;
private void Example()
{
// [전제 1] 심볼 "정의"(템플릿)를 xml 에서 먼저 로드해야 이름으로 생성 가능.
// xml 은 GenerateSymbalResource 로 dxf 폴더에서 생성하거나, 배포된 VIZCore3D.Symbol.xml 사용.
vizcore3d.Review.Symbol.AddResource(@"C:\Data\VIZCore3D.Symbol.xml");
// [전제 2] 로드된 정의 중 하나의 "이름" 획득(여기선 첫 번째). 이 이름으로 생성할 심볼 지정.
string name = vizcore3d.Review.Symbol.GetName(0);
// 마우스 없이 월드 좌표 (100,200,0) 에 생성 배치.
// - anchor = Center : (100,200,0) 이 Symbol 중심에 오도록 (BottomLeft 등으로 바꾸면 그 모서리 기준).
// - 방향은 심볼의 오른쪽(rightDir)과 위쪽(upDir) 두 방향으로 결정.
// 오른쪽=+X, 위쪽=+Y → XY 평면(무회전, Top View 에서 읽히는 방향).
// - 반환 idx : 생성된 "배치 인스턴스"의 인덱스(실패 시 -1). 이후 Get/Set/Orientation API 에 이 idx 사용.
int idx = vizcore3d.Review.Symbol.AddSymbolAtPosition(
name,
new VIZCore3D.NET.Data.Vertex3D(100.0f, 200.0f, 0.0f),
VIZCore3D.NET.Data.AnchorPoint.Center,
new VIZCore3D.NET.Data.Vertex3D(1.0f, 0.0f, 0.0f), // rightDir : 오른쪽 방향
new VIZCore3D.NET.Data.Vertex3D(0.0f, 1.0f, 0.0f), // upDir : 위쪽 방향
1.0f);
// 편의 오버로드: 방향(XY 평면)·anchor(Center) 를 기본값으로 두고 좌표만 지정.
int idx2 = vizcore3d.Review.Symbol.AddSymbolAtPosition(
name, new VIZCore3D.NET.Data.Vertex3D(300.0f, 200.0f, 0.0f));
}
AddSymbolAtPosition(string name, Vertex3D position, AnchorPoint anchor)
public int AddSymbolAtPosition(string name, Vertex3D position, AnchorPoint anchor)
지정 이름의 Symbol 정의를 특정 월드 좌표에 생성 배치 — 기본 방향(XY 평면, 무회전).
Parameters
| Name | Type | Description |
|---|---|---|
| name | string | 로드된 Symbol 정의 이름 |
| position | Vertex3D | 배치 목표 월드 좌표 |
| anchor | AnchorPoint | position 에 맞출 기준 anchor |
Returns
| Type | Description |
|---|---|
| int | 생성된 배치 Symbol 인덱스. 실패 시 -1. |
AddSymbolAtPosition(string name, Vertex3D position)
public int AddSymbolAtPosition(string name, Vertex3D position)
지정 이름의 Symbol 정의를 특정 월드 좌표에 생성 배치 — position 이 심볼 중심(Center)에 오도록
기본 방향(XY 평면, 무회전)으로 배치.
Parameters
| Name | Type | Description |
|---|---|---|
| name | string | 로드된 Symbol 정의 이름 |
| position | Vertex3D | 배치 목표 월드 좌표 (심볼 중심 기준) |
Returns
| Type | Description |
|---|---|
| int | 생성된 배치 Symbol 인덱스. 실패 시 -1. |