소스 정보
- 저장소
- 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-mtext명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SOC 직업 분류 기준
SKILL.md 표시 중
| name | acad-mtext |
| description | MText and DBText — creation, formatting codes, columns, fragment parsing |
Use this skill when creating or modifying text objects - multiline text (MText), single-line text (DBText), text styles, and formatted text content.
using (Transaction tr = db.TransactionManager.StartTransaction())
{
BlockTableRecord btr = (BlockTableRecord)tr.GetObject(
db.CurrentSpaceId, OpenMode.ForWrite);
MText mtext = new MText();
mtext.Location = new Point3d(100, 200, 0);
mtext.Width = 200.0;
mtext.TextHeight = 2.5;
mtext.Contents = "Line 1\\PLine 2"; // \\P = paragraph break
mtext.Attachment = AttachmentPoint.TopLeft;
mtext.TextStyleId = db.Textstyle; // current text style
btr.AppendEntity(mtext);
tr.AddNewlyCreatedDBObject(mtext, true);
tr.Commit();
}
// Static columns (fixed count)
mtext.SetStaticColumns(150.0, 10.0, 3); // width, gutter, count
// Dynamic columns (auto-flow based on height)
mtext.SetDynamicColumns(150.0, 10.0, true); // width, gutter, autoHeight
// Read column settings
ColumnType colType = mtext.ColumnType; // NoColumns, StaticColumns, DynamicColumns
int count = mtext.ColumnCount;
double width = mtext.ColumnWidth;
double gutter = mtext.ColumnGutterWidth;
bool autoHt = mtext.ColumnAutoHeight;
bool reversed = mtext.ColumnFlowReversed;
// Per-column heights (static columns)
mtext.SetColumnHeight(0, 100.0);
double h = mtext.GetColumnHeight(0);
Common formatting codes used in Contents string:
| Code | Effect | Example |
|---|---|---|
\\P | Paragraph break (new line) | "Line 1\\PLine 2" |
{\\fArial;text} | Font change | "{\\fArial|b1;Bold Arial}" |
{\\H2.5;text} | Height change | "{\\H3.0;Big text}" |
{\\C1;text} | Color change (ACI) | "{\\C1;Red text}" |
{\\W1.5;text} | Width factor | "{\\W2.0;Wide text}" |
{\\O text\\o} | Overline on/off | |
{\\L text\\l} | Underline on/off | |
{\\K text\\k} | Strikethrough on/off | |
{\\Q30;text} | Oblique angle | "{\\Q15;Slanted}" |
{\\T1.5;text} | Tracking (letter spacing) | |
\\S | Stacking (fractions) | "\\S1/2;" |
\\A | Alignment (0=bottom, 1=center, 2=top) | "\\A1;centered" |
Static formatting code properties (all string, get-only):
MText.BlockBegin, MText.BlockEnd, MText.ParagraphBreak, MText.LineBreak, MText.FontChange, MText.HeightChange, MText.WidthChange, MText.ColorChange, MText.TrackChange, MText.ObliqueChange, MText.AlignChange, MText.UnderlineOn, MText.UnderlineOff, MText.OverlineOn, MText.OverlineOff, MText.StrikethroughOn, MText.StrikethroughOff, MText.StackStart, MText.NonBreakSpace
Use ExplodeFragments to iterate through formatted text fragments:
mtext.ExplodeFragments(FragmentCallback, null);
private static MTextFragmentCallbackStatus FragmentCallback(
MTextFragment fragment, object userData)
{
// Each fragment has its own formatting
string text = fragment.Text;
Point3d loc = fragment.Location;
double height = fragment.CapsHeight;
bool bold = fragment.Bold;
bool italic = fragment.Italic;
bool underline = fragment.Underlined;
bool overline = fragment.Overlined;
bool strikethrough = fragment.Strikethrough;
double widthFactor = fragment.WidthFactor;
double oblique = fragment.ObliqueAngle;
double tracking = fragment.TrackingFactor;
EntityColor color = fragment.Color;
Vector3d direction = fragment.Direction;
Vector3d normal = fragment.Normal;
Point2d extents = fragment.Extents;
string ttFont = fragment.TrueTypeFont;
string shxFont = fragment.ShxFont;
string bigFont = fragment.BigFont;
bool stackTop = fragment.StackTop;
bool stackBottom = fragment.StackBottom;
// Underline/overline geometry
Point3d[] underlinePts = fragment.GetUnderLinePoints();
Point3d[] overlinePts = fragment.GetOverLinePoints();
Point3d[] strikePts = fragment.GetStrikethroughPoints();
return MTextFragmentCallbackStatus.Continue; // or Terminate
}
Delegate signature: delegate MTextFragmentCallbackStatus MTextFragmentCallback(MTextFragment fragment, object userData)
Overloads:
ExplodeFragments(MTextFragmentCallback enumerator)ExplodeFragments(MTextFragmentCallback enumerator, object userData)ExplodeFragments(MTextFragmentCallback enumerator, object userData, WorldDraw context)DBText text = new DBText();
text.Position = new Point3d(100, 200, 0);
text.TextString = "Hello World";
text.Height = 2.5;
text.Rotation = 0.0;
text.TextStyleId = db.Textstyle;
text.WidthFactor = 1.0;
text.Oblique = 0.0;
btr.AppendEntity(text);
tr.AddNewlyCreatedDBObject(text, true);
// Create new text style
TextStyleTableRecord style = new TextStyleTableRecord();
style.Name = "MyStyle";
style.FileName = "arial.ttf"; // or "romans.shx"
style.BigFontFileName = ""; // for CJK fonts
style.TextSize = 0.0; // 0 = variable height
style.XScale = 1.0; // width factor
style.ObliquingAngle = 0.0;
style.IsVertical = false;
TextStyleTable tst = (TextStyleTable)tr.GetObject(
db.TextStyleTableId, OpenMode.ForWrite);
ObjectId styleId = tst.Add(style);
tr.AddNewlyCreatedDBObject(style, true);
// Font descriptor (alternative to FileName)
style.Font = new FontDescriptor("Arial", false, false, 0, 0);
AttachmentPoint: TopLeft=1, TopCenter=2, TopRight=3, MiddleLeft=4, MiddleCenter=5, MiddleRight=6, BottomLeft=7, BottomCenter=8, BottomRight=9, BaseLeft=10, BaseCenter=11, BaseRight=12, BaseAlign=13, BottomAlign=14, MiddleAlign=15, TopAlign=16, BaseFit=17, BottomFit=18, MiddleFit=19, TopFit=20, BaseMid=21, BottomMid=22, MiddleMid=23, TopMid=24
FlowDirection: NotSet=0, LeftToRight=1, RightToLeft=2, TopToBottom=3, BottomToTop=4, ByStyle=5
ColumnType: NoColumns=0, StaticColumns=1, DynamicColumns=2
LineSpacingStyle: AtLeast=1, Exactly=2
TextHorizontalMode: TextLeft=0, TextCenter=1, TextRight=2, TextAlign=3, TextMid=4, TextFit=5
TextVerticalMode: TextBase=0, TextBottom=1, TextVerticalMid=2, TextTop=3
\P (backslash-P). In a C# regular string literal write it as "\\P" (the \\ escape = one backslash). In a verbatim string literal write it as @"\P". Do NOT use "\\\\P" — that produces a double backslash and won't render as a line breakAttachmentPoint enum is shared between MText and DBText but means different things - MText uses it for Attachment, DBText uses it for JustifyHorizontalMode/VerticalMode AND AlignmentPoint for non-default justification; Position alone only works for left-justified textAdjustAlignment(db) on DBText after changing alignment modesWidth of 0 means no wrapping (single line); set a non-zero width for multiline textTextHeight on MText is the character height; Height is the overall bounding box heightActualWidth/ActualHeight are only valid after the MText has been added to the database{} for scope - mismatched braces corrupt the textTextStyleId must reference an existing TextStyleTableRecord - use db.Textstyle for the current styleacad-fields — embedding dynamic fields in MText contentacad-mleaders — MText as MLeader text contentacad-dimensions — MText formatting in dimension text overridesacad-tables — MText content in table cells