소스 정보
- 저장소
- hebackus/c3d-api-plugin
- 최근 소스 활동
- 2026년 4월 9일 01:53
- 감지된 SKILL.md 언어
- 영어
- 스타
- 3
- 포크
- 0
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/hebackus/c3d-api-plugin --skill acad-mleaders명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SOC 직업 분류 기준
SKILL.md 표시 중
| name | acad-mleaders |
| description | Multileaders — leader lines, MText/Block content, dogleg/landing, MLeaderStyle |
Use this skill when creating or modifying multileader objects - leaders with text, block, or tolerance content.
MLeader
├── Leader 0
│ ├── LeaderLine 0 (vertices: first → ... → last/arrow)
│ └── LeaderLine 1
├── Leader 1
│ └── LeaderLine 0
└── Content (MText, Block, or Tolerance - shared across all leaders)
An MLeader contains one or more Leaders (collections of leader lines pointing to the same content side). Each Leader contains one or more LeaderLines, each with multiple Vertices. The first vertex is the landing/connection point near content; the last vertex is the arrow tip.
using (Transaction tr = db.TransactionManager.StartTransaction())
{
BlockTableRecord btr = (BlockTableRecord)tr.GetObject(
db.CurrentSpaceId, OpenMode.ForWrite);
MLeader mleader = new MLeader();
mleader.SetDatabaseDefaults();
// Set content type
mleader.ContentType = ContentType.MTextContent;
// Create MText content
MText mt = new MText();
mt.Contents = "Label Text";
mt.TextHeight = 2.5;
mleader.MText = mt;
// Add a leader with one leader line
int leaderIdx = mleader.AddLeader();
int lineIdx = mleader.AddLeaderLine(leaderIdx);
// Add vertices (last = arrow tip, first = near content)
mleader.AddFirstVertex(lineIdx, new Point3d(200, 200, 0));
mleader.AddLastVertex(lineIdx, new Point3d(100, 100, 0));
// Set text location
mleader.TextLocation = new Point3d(210, 200, 0);
btr.AppendEntity(mleader);
tr.AddNewlyCreatedDBObject(mleader, true);
tr.Commit();
}
MLeader mleader = new MLeader();
mleader.SetDatabaseDefaults();
mleader.ContentType = ContentType.BlockContent;
mleader.BlockContentId = blockDefId; // ObjectId of BlockTableRecord
mleader.BlockPosition = new Point3d(200, 200, 0);
mleader.BlockScale = new Scale3d(1.0);
mleader.BlockRotation = 0.0;
mleader.BlockColor = Color.FromColorIndex(ColorMethod.ByLayer, 256);
mleader.BlockConnectionType = BlockConnectionType.ConnectExtents;
// or BlockConnectionType.ConnectBase
int leaderIdx = mleader.AddLeader();
int lineIdx = mleader.AddLeaderLine(leaderIdx);
mleader.AddFirstVertex(lineIdx, new Point3d(200, 200, 0));
mleader.AddLastVertex(lineIdx, new Point3d(100, 100, 0));
// Add leaders and lines
int leaderIdx = mleader.AddLeader();
int lineIdx = mleader.AddLeaderLine(leaderIdx);
// or: int lineIdx = mleader.AddLeaderLine(new Point3d(x, y, z)); // adds to default leader
// Get all leader/line indexes
ArrayList leaderIndexes = mleader.GetLeaderIndexes();
ArrayList lineIndexes = mleader.GetLeaderLineIndexes(leaderIdx);
// Get parent leader of a line
int parentLeader = mleader.GetLeaderIndex(lineIdx);
// Remove
mleader.RemoveLeaderLine(lineIdx);
mleader.RemoveLeader(leaderIdx);
// Add vertices
mleader.AddFirstVertex(lineIdx, connectionPoint); // near content
mleader.AddLastVertex(lineIdx, arrowPoint); // arrow tip
// Get/set vertices
Point3d first = mleader.GetFirstVertex(lineIdx);
Point3d last = mleader.GetLastVertex(lineIdx);
mleader.SetFirstVertex(lineIdx, newPoint);
mleader.SetLastVertex(lineIdx, newPoint);
// Middle vertices
int count = mleader.VerticesCount(lineIdx);
Point3d pt = mleader.GetVertex(lineIdx, 1); // 0-indexed
mleader.SetVertex(lineIdx, 1, newPoint);
// Remove vertices
mleader.RemoveFirstVertex(lineIdx);
mleader.RemoveLastVertex(lineIdx);
// Dogleg per leader
mleader.SetDogleg(leaderIdx, new Vector3d(1, 0, 0));
Vector3d dogDir = mleader.GetDogleg(leaderIdx);
mleader.SetDoglegLength(leaderIdx, 5.0);
double dogLen = mleader.GetDoglegLength(leaderIdx);
// Per-line leader appearance overrides
mleader.SetLeaderLineType(lineIdx, LeaderType.SplineLeader);
mleader.SetLeaderLineColor(lineIdx, Color.FromColorIndex(ColorMethod.ByAci, 1));
mleader.SetLeaderLineWeight(lineIdx, LineWeight.LineWeight050);
mleader.SetArrowSymbolId(lineIdx, arrowBlockId);
mleader.SetArrowSize(lineIdx, 3.0);
// Read overrides
LeaderType lt = mleader.GetLeaderLineType(lineIdx);
Color lc = mleader.GetLeaderLineColor(lineIdx);
// Set attachment type for specific leader direction
mleader.SetTextAttachmentType(
TextAttachmentType.AttachmentMiddle,
LeaderDirectionType.LeftLeader);
TextAttachmentType att = mleader.GetTextAttachmentType(
LeaderDirectionType.RightLeader);
// Read/write attributes on block content
AttributeReference attRef = mleader.GetBlockAttribute(attDefId);
string val = attRef.TextString;
attRef.TextString = "New Value";
mleader.SetBlockAttribute(attDefId, attRef);
// Move entire MLeader
mleader.MoveMLeader(new Vector3d(50, 50, 0), MoveType.MoveAllPoints);
MoveType enum: MoveAllPoints=0, MoveAllExceptArrowHeaderPoints=1, MoveContentAndDoglegPoints=2
// Create a new style
MLeaderStyle style = new MLeaderStyle();
// or copy: new MLeaderStyle(existingStyle);
style.Name = "My Leader Style";
style.ContentType = ContentType.MTextContent;
style.TextHeight = 2.5;
style.TextStyleId = textStyleId;
style.TextColor = Color.FromColorIndex(ColorMethod.ByLayer, 256);
style.TextAlignmentType = TextAlignmentType.LeftAlignment;
style.TextAlignAlwaysLeft = false;
style.TextAngleType = TextAngleType.HorizontalAngle;
style.EnableFrameText = false;
// Leader line settings
style.LeaderLineType = LeaderType.StraightLeader;
style.LeaderLineColor = Color.FromColorIndex(ColorMethod.ByBlock, 0);
style.ArrowSymbolId = ObjectId.Null; // default arrow
style.ArrowSize = 3.0;
style.EnableDogleg = true;
style.DoglegLength = 8.0;
style.EnableLanding = true;
style.LandingGap = 2.0;
style.ExtendLeaderToText = true;
// Block content defaults
style.BlockId = blockId;
style.BlockConnectionType = BlockConnectionType.ConnectExtents;
style.BlockScale = new Scale3d(1.0);
style.EnableBlockScale = false;
style.EnableBlockRotation = false;
// Workflow
style.Scale = 1.0;
style.BreakSize = 2.0;
style.MaxLeaderSegmentsPoints = 2;
style.FirstSegmentAngleConstraint = AngleConstraint.DegreesAny;
style.SecondSegmentAngleConstraint = AngleConstraint.DegreesAny;
style.DrawLeaderOrderType = DrawLeaderOrderType.DrawLeaderHeadFirst;
style.DrawMLeaderOrderType = DrawMLeaderOrderType.DrawContentFirst;
// Text attachment per direction
style.SetTextAttachmentType(
TextAttachmentType.AttachmentMiddleOfTop, LeaderDirectionType.LeftLeader);
style.SetTextAttachmentType(
TextAttachmentType.AttachmentMiddleOfTop, LeaderDirectionType.RightLeader);
style.TextAttachmentDirection = TextAttachmentDirection.AttachmentHorizontal;
// Post to database
ObjectId styleId = style.PostMLeaderStyleToDb(db, );
tr.AddNewlyCreatedDBObject(style, );
TextAttachmentType: AttachmentTopOfTop=0, AttachmentMiddleOfTop=1, AttachmentMiddle=2, AttachmentMiddleOfBottom=3, AttachmentBottomOfBottom=4, AttachmentBottomLine=5, AttachmentBottomOfTopLine=6, AttachmentBottomOfTop=7, AttachmentAllLine=8, AttachmentCenter=9, AttachmentLinedCenter=10
LeaderDirectionType: UnknownLeader=0, LeftLeader=1, RightLeader=2, TopLeader=3, BottomLeader=4
AngleConstraint: DegreesAny=0, Degrees015=1, Degrees030=2, Degrees045=3, Degrees060=4, Degrees090=6, DegreesHorz=12
DrawLeaderOrderType: DrawLeaderHeadFirst=0, DrawLeaderTailFirst=1
DrawMLeaderOrderType: DrawContentFirst=0, DrawLeaderFirst=1
The OARX guide documents the older Leader class (not MLeader). Prefer MLeader for new code. Use Leader only when working with legacy drawings that contain it.
using (Transaction tr = db.TransactionManager.StartTransaction())
{
BlockTableRecord btr = (BlockTableRecord)tr.GetObject(
db.CurrentSpaceId, OpenMode.ForWrite);
Leader leader = new Leader();
leader.SetDatabaseDefaults();
// Add vertices (start at arrow tip, end at annotation)
leader.AppendVertex(new Point3d(100, 100, 0)); // arrow tip
leader.AppendVertex(new Point3d(200, 150, 0)); // elbow
leader.AppendVertex(new Point3d(250, 150, 0)); // near annotation
leader.HasArrowHead = true;
leader.IsSplined = false;
btr.AppendEntity(leader);
tr.AddNewlyCreatedDBObject(leader, true);
// Attach annotation (must be added to DB first)
MText mt = new MText();
mt.Location = new Point3d(252, 150, 0);
mt.Contents = "Leader Text";
mt.TextHeight = 2.5;
btr.AppendEntity(mt);
tr.AddNewlyCreatedDBObject(mt, true);
leader.Annotation = mt.ObjectId; // attach annotation
leader.EvaluateLeader(); // MUST call to update hook geometry
tr.Commit();
}
GetLeaderIndexes() and GetLeaderLineIndexes() to get valid indexesAddLeaderLine(Point3d) adds a line to a default leader; AddLeaderLine(int leaderIndex) adds to a specific leader - different signatures do different thingsMText property replaces the content object entirely; modify the existing MText object for incremental changesMLeaderStyle must be posted to the database with PostMLeaderStyleToDb() before it can be assigned to an MLeaderMoveType.MoveAllExceptArrowHeaderPoints keeps arrow tips fixed while moving content - useful for repositioning text without changing what the leader points toTextAttachmentType and direction interact: horizontal leaders use top/middle/bottom attachment; vertical leaders use center/lined attachmentacad-mtext — MText as MLeader text contentacad-blocks — block references as MLeader block contentacad-geometry — Point3d for leader vertices and attachment points