-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathObjectARX-Beginner-Tutorial.html
More file actions
2859 lines (2506 loc) · 160 KB
/
Copy pathObjectARX-Beginner-Tutorial.html
File metadata and controls
2859 lines (2506 loc) · 160 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>ObjectARX for Beginners — AutoCAD 2027 / Visual Studio 2026</title>
<style>
:root{
/* Autodesk brand: Black/White primary, Slate/Warm Slate secondary,
Twilight (tertiary) as the single functional accent. */
--bg:#ffffff; --fg:#000000; --muted:#666666; --border:#d5d5cb;
--accent:#11577d; --accent-fill:#11577d; --accent-ink:#ffffff; --link:#11577d;
--code-bg:#f4f4f0; --code-fg:#000000; --alt:#f7f7f3;
--tip-bg:#eaf3f8; --tip-bd:#1d91d0; --warn-bg:#fdece0; --warn-bd:#f2520a;
--shot-bg:#f4f4f0; --shot-bd:#c9c7bd; --sidebar-bg:#f7f7f3;
--kw:#0000ff; --cm:#008000; --str:#a31515;
}
@media (prefers-color-scheme:dark){
:root{
--bg:#000000; --fg:#ffffff; --muted:#a9a89e; --border:#3a392f;
--accent:#5fc3ea; --accent-fill:#1d91d0; --accent-ink:#0b0b0a; --link:#5fc3ea;
--code-bg:#1c1c18; --code-fg:#ffffff; --alt:#171612;
--tip-bg:#07283a; --tip-bd:#1d91d0; --warn-bg:#3a2210; --warn-bd:#f2520a;
--shot-bg:#1c1c18; --shot-bd:#514f43; --sidebar-bg:#141412;
--kw:#569cd6; --cm:#6a9955; --str:#ce9178;
}
}
*{box-sizing:border-box;}
body{margin:0;background:var(--bg);color:var(--fg);
font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;
line-height:1.65;font-size:16px;}
a{color:var(--link);text-decoration:none;} a:hover{text-decoration:underline;}
/* Layout: sidebar + content */
.layout{display:flex;align-items:flex-start;max-width:1200px;margin:0 auto;}
nav.toc{position:sticky;top:0;align-self:flex-start;flex:0 0 268px;height:100vh;
overflow-y:auto;background:var(--sidebar-bg);border-right:1px solid var(--border);
padding:20px 16px;font-size:.9rem;}
nav.toc .brand{font-weight:700;color:var(--accent);font-size:1rem;margin-bottom:4px;}
nav.toc .sub{color:var(--muted);font-size:.78rem;margin-bottom:16px;}
nav.toc a{display:block;color:var(--fg);padding:3px 8px;border-radius:6px;}
nav.toc a:hover{background:rgba(128,128,128,.14);text-decoration:none;}
nav.toc .group{font-weight:700;color:var(--accent);margin:14px 0 4px;font-size:.82rem;
text-transform:uppercase;letter-spacing:.03em;}
nav.toc a.child{padding-left:20px;color:var(--muted);font-size:.86rem;}
main{flex:1 1 auto;min-width:0;padding:0 40px 100px;max-width:900px;}
/* CHM-style heading band — Autodesk Black, fixed regardless of theme,
with a Twilight accent rule so it reads in both light and dark mode. */
.band{background:#000;color:#fff;margin:0 -40px 22px;padding:26px 40px 22px;
border-bottom:3px solid #1d91d0;}
.band h1{margin:0;font-size:1.7rem;font-weight:600;color:#fff;}
.band .kicker{font-size:.8rem;text-transform:uppercase;letter-spacing:.08em;color:#1d91d0;}
h2{color:var(--accent);font-size:1.35rem;border-bottom:2px solid var(--border);
padding-bottom:.25em;margin-top:2.4em;}
h3{font-size:1.08rem;margin-top:1.8em;}
p,li{color:var(--fg);}
blockquote{margin:1em 0;padding:.3em 1em;border-left:.25em solid var(--border);color:var(--muted);}
code{background:var(--code-bg);padding:.15em .4em;border-radius:6px;
font-family:Consolas,"SF Mono",Menlo,"Courier New",monospace;font-size:.88em;
font-variant-ligatures:none;font-feature-settings:"liga" 0,"calt" 0;}
pre{background:var(--code-bg);color:var(--code-fg);border:1px solid var(--border);
border-radius:8px;padding:14px 16px;overflow-x:auto;line-height:1.5;
font-variant-ligatures:none;font-feature-settings:"liga" 0,"calt" 0;}
pre code{background:none;padding:0;font-size:.85em;}
pre .kw{color:var(--kw);} pre .cm{color:var(--cm);} pre .str{color:var(--str);}
.code-block{position:relative;}
.code-block pre{margin:0;padding-right:80px;}
.copy-btn{position:absolute;top:10px;right:10px;background:var(--accent-fill);color:var(--accent-ink);border:none;
border-radius:6px;padding:4px 10px;font-size:.75rem;line-height:1.4;cursor:pointer;opacity:.85;
font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;}
.copy-btn:hover{opacity:1;}
.copy-btn.copied{background:#2da44e;color:#fff;}
table{border-collapse:collapse;width:100%;margin:1.1em 0;display:block;overflow-x:auto;}
th,td{border:1px solid var(--border);padding:8px 12px;text-align:left;vertical-align:top;}
th{background:var(--alt);color:var(--accent);}
tr:nth-child(even) td{background:var(--alt);}
.callout{border-radius:8px;padding:12px 16px;margin:1.2em 0;border:1px solid;}
.tip{background:var(--tip-bg);border-color:var(--tip-bd);}
.warn{background:var(--warn-bg);border-color:var(--warn-bd);}
.callout p{margin:.3em 0;} .callout .lbl{font-weight:700;}
hr{border:none;border-top:1px solid var(--border);margin:2.4em 0;}
.next{background:var(--alt);border:1px solid var(--border);border-radius:8px;
padding:10px 14px;margin-top:1.6em;font-size:.95rem;}
/* Screenshot slots */
figure.shot{margin:1.5em 0;text-align:center;}
figure.shot img{max-width:100%;border:1px solid var(--border);border-radius:8px;}
.shot-placeholder{display:none;flex-direction:column;align-items:center;justify-content:center;
gap:6px;min-height:140px;background:var(--shot-bg);border:2px dashed var(--shot-bd);
border-radius:8px;color:var(--muted);padding:18px;font-size:.9rem;}
.shot-placeholder .cam{font-size:1.5rem;}
.shot-placeholder code{background:var(--bg);}
figure.shot figcaption{color:var(--muted);font-size:.85rem;margin-top:.5em;font-style:italic;}
.badge{display:inline-block;background:var(--accent-fill);color:var(--accent-ink);border-radius:4px;
padding:0 6px;font-size:.72rem;margin-right:6px;vertical-align:middle;}
.fig{font-weight:700;color:var(--accent);font-size:.85rem;}
@media (max-width:820px){
.layout{flex-direction:column;}
nav.toc{position:static;height:auto;width:100%;flex-basis:auto;border-right:none;
border-bottom:1px solid var(--border);}
main{padding:0 20px 60px;}
.band{margin:0 -20px 20px;padding:22px 20px;}
}
</style>
</head>
<body>
<div class="layout">
<nav class="toc">
<div class="brand">ObjectARX for Beginners</div>
<div class="sub">AutoCAD 2027 · Visual Studio 2026</div>
<a href="#intro">Introduction</a>
<a href="#setup">Getting Set Up — Downloads</a>
<div class="group">Lesson 1 — From Scratch</div>
<a class="child" href="#l1-intro">Overview</a>
<a class="child" href="#l1-project">1. Create the project</a>
<a class="child" href="#l1-compiler">2. Compiler settings</a>
<a class="child" href="#l1-linker">3. Linker settings</a>
<a class="child" href="#l1-code">4. Add the code</a>
<a class="child" href="#l1-def">5. The .def file</a>
<a class="child" href="#l1-run">6. Build & run</a>
<div class="group">Lesson 2 — With Claude Code</div>
<a class="child" href="#l2-intro">Overview</a>
<a class="child" href="#l2-claude">1. What is Claude Code</a>
<a class="child" href="#l2-skill">2. Get the wizard skill</a>
<a class="child" href="#l2-create">3. Scaffold the project</a>
<a class="child" href="#l2-more">4. What the skill adds</a>
<a class="child" href="#l2-addons">5. Add-on class wizards</a>
<a class="child" href="#l2-run">6. Build & run</a>
<div class="group">Lesson 3 — Input & Selection</div>
<a class="child" href="#l3-intro">Overview</a>
<a class="child" href="#l3-add">1. Add the two commands</a>
<a class="child" href="#l3-input">2. The MYINPUT command</a>
<a class="child" href="#l3-select">3. The MYSELECT command</a>
<a class="child" href="#l3-run">4. Build & test</a>
<div class="group">Lesson 4 — Symbol Tables</div>
<a class="child" href="#l4-intro">Overview</a>
<a class="child" href="#l4-project">1. Template project (skill)</a>
<a class="child" href="#l4-utils">2. Utility functions</a>
<a class="child" href="#l4-cmds">3. CREATE & SETLAYER</a>
<a class="child" href="#l4-run">4. Build & test</a>
<div class="group">Lesson 5 — Dictionaries & Xrecords</div>
<a class="child" href="#l5-intro">Overview</a>
<a class="child" href="#l5-project">1. Template project (skill)</a>
<a class="child" href="#l5-cmds">2. The three commands</a>
<a class="child" href="#l5-run">3. Build & test</a>
<div class="group">Lesson 6 — Custom Objects</div>
<a class="child" href="#l6-intro">Overview</a>
<a class="child" href="#l6-dbxproj">1. Create the DBX project</a>
<a class="child" href="#l6-class">2. The custom object class</a>
<a class="child" href="#l6-members">3. Members & accessors</a>
<a class="child" href="#l6-register">4. Register & build the DBX</a>
<a class="child" href="#l6-cmds">5. The ARX commands</a>
<a class="child" href="#l6-load">6. Load the DBX</a>
<a class="child" href="#l6-run">7. Build & test</a>
<div class="group">Lesson 7 — Custom Entities</div>
<a class="child" href="#l7-intro">Overview</a>
<a class="child" href="#l7-dbxproj">1. Create the DBX project</a>
<a class="child" href="#l7-class">2. The custom entity class</a>
<a class="child" href="#l7-members">3. Members & accessors</a>
<a class="child" href="#l7-worlddraw">4. worldDraw() & the constructor</a>
<a class="child" href="#l7-register">5. Register & build the DBX</a>
<a class="child" href="#l7-cmds">6. The CREATEEMPLOYEE command</a>
<a class="child" href="#l7-load">7. Load the DBX</a>
<a class="child" href="#l7-run">8. Build & test</a>
<div class="group">Lesson 8 — Transient Reactors</div>
<a class="child" href="#l8-intro">Overview</a>
<a class="child" href="#l8-docdata">1. Project & document data</a>
<a class="child" href="#l8-edreactor">2. The editor reactor</a>
<a class="child" href="#l8-objreactor">3. The object reactor</a>
<a class="child" href="#l8-utility">4. Attach/detach utilities</a>
<a class="child" href="#l8-dbreactor">5. The database reactor</a>
<a class="child" href="#l8-run">6. Build & test</a>
<a href="#trouble" style="margin-top:14px;">Troubleshooting</a>
</nav>
<main>
<!-- ============ INTRODUCTION ============ -->
<section id="intro">
<div class="band">
<div class="kicker">ObjectARX Training</div>
<h1>Introduction</h1>
</div>
<p>Welcome! This tutorial teaches you how to write your first <strong>ObjectARX</strong> plug-in for
AutoCAD — twice.</p>
<div class="callout tip">
<p><span class="lbl">What is ObjectARX?</span> It is the C++ toolkit (SDK) for building programs that
run <em>inside</em> AutoCAD. A finished plug-in is an <code>.arx</code> file — really a Windows DLL with a
different extension. AutoCAD loads it, and your code can add commands, draw objects, and react to
what the user does.</p>
</div>
<p>You'll do the same small task two ways, so you understand both the <em>fundamentals</em> and the
<em>fast path</em>:</p>
<ul>
<li><strong>Lesson 1 — From scratch.</strong> You set up an empty C++ project by hand and wire up every
setting yourself. This is slower, but it shows you exactly what an ObjectARX project <em>is</em>.</li>
<li><strong>Lesson 2 — With Claude Code.</strong> You use an AI assistant and a ready-made "wizard skill"
to generate the same kind of project in seconds — then focus on your code instead of the plumbing.</li>
</ul>
<p>Both lessons end the same way: you type a command in AutoCAD and see a message appear. Start by
installing the tools.</p>
</section>
<!-- ============ SETUP / DOWNLOADS ============ -->
<section id="setup">
<div class="band">
<div class="kicker">Before you begin</div>
<h1>Getting Set Up — What to Download</h1>
</div>
<p>You need three things installed. Install them in this order.</p>
<h3>1. AutoCAD 2027</h3>
<p>The host program your plug-in runs inside. Download and install it from your Autodesk account
(<a href="https://manage.autodesk.com">manage.autodesk.com</a>), or get a free version through the
<a href="https://www.autodesk.com/education/edu-software/overview">Autodesk Education</a> program if you
are a student or educator. AutoCAD is <strong>64-bit only</strong> — there has been no 32-bit AutoCAD
since 2020.</p>
<h3>2. The ObjectARX 2027 SDK</h3>
<p>This is the free package of C++ header files (<code>.h</code>) and libraries (<code>.lib</code>) you
build against. Get it from the Autodesk Platform Services developer page for AutoCAD:
<a href="https://aps.autodesk.com/developer/overview/autocad">aps.autodesk.com/developer/overview/autocad</a>.
Go to the APIs section and click on the <a href="https://aps.autodesk.com/developer/overview/objectarx-autocad-sdk">ObjectARX SDK</a> hyperlink,
click on "View license agreement" and proceed with further steps. Unzip it to a simple path with no spaces, for example <code>C:\ObjectARX 2027\</code>.
Remember this
location — you'll point Visual Studio at it.</p>
<div class="callout tip">
<p><span class="lbl">Tip.</span> Inside the SDK you'll mainly use two folders: <code>inc</code> (and
<code>inc-x64</code>) for headers, and <code>lib-x64</code> for libraries.</p>
</div>
<h3>3. Visual Studio 2026</h3>
<p>The editor and C++ compiler (the "IDE"). The free
<a href="https://visualstudio.microsoft.com/">Community edition</a> is fine. During installation, tick
the <strong>"Desktop development with C++"</strong> workload — that's the part that gives you the C++
compiler ObjectARX needs.</p>
<table>
<thead><tr><th>Tool</th><th>Why you need it</th></tr></thead>
<tbody>
<tr><td>AutoCAD 2027 (64-bit)</td><td>Runs your finished plug-in</td></tr>
<tr><td>ObjectARX 2027 SDK</td><td>Headers + libraries you compile against</td></tr>
<tr><td>Visual Studio 2026 + "Desktop development with C++"</td><td>Writes and builds the code</td></tr>
</tbody>
</table>
<div class="callout tip">
<p><span class="lbl">Solved projects.</span> A <code>Solutions</code> folder ships alongside this tutorial
with a finished, working project for every lesson (<code>LessonN_Solved.zip</code>) — handy if you get stuck
partway through. Each lesson links directly to its own zip near the end of that lesson.</p>
</div>
<div class="next">▶ Next: <a href="#l1-intro">Lesson 1 — Build an ObjectARX app from scratch</a></div>
</section>
<!-- ============ LESSON 1 ============ -->
<section id="l1-intro">
<div class="band">
<div class="kicker">Lesson 1 · No AI, no wizard</div>
<h1>Build an ObjectARX App From Scratch</h1>
</div>
<p>In this lesson you create a new ObjectARX project in Visual Studio 2026 <strong>completely by hand</strong>
and build your first application. There is no template to start from — you'll do every step yourself, so
you learn what each piece is for.</p>
<p>The goal is small on purpose: a command called <code>HELLO</code> that prints
<em>"Hello World!"</em> on the AutoCAD command line.</p>
<div class="callout tip">
<p><span class="lbl">Why do it by hand first.</span> Doing it once by hand is how the settings "click."
Lesson 2 shows how the wizard automates all of this for you.</p>
</div>
</section>
<section id="l1-project">
<h2>Step 1 — Create the project</h2>
<ol>
<li>In Visual Studio, choose <strong>Create a New Project…</strong></li>
<li>Search for and select the <strong>"Windows Desktop Wizard"</strong> template (a plain C++ template),
then click <strong>Next</strong>.</li>
</ol>
<figure class="shot">
<img src="images/l1-01-template.png" alt="Windows Desktop Wizard template" onerror="this.style.display='none';this.nextElementSibling.style.display='flex';">
<div class="shot-placeholder"><span class="cam">📷</span>
<div><span class="badge">SLOT</span>Save as <code>images/l1-01-template.png</code></div>
<div>The template picker with "Windows Desktop Wizard" selected.</div></div>
<figcaption><span class="fig">Lesson 1, Figure 1</span> — Picking the Windows Desktop Wizard template.</figcaption>
</figure>
<ol start="3">
<li>Enter a project name — this tutorial uses <strong><code>Step01</code></strong> — pick a location, and click
<strong>Create</strong>.</li>
<li>In the "Windows Desktop Project" dialog, set <strong>Application type</strong> to
<strong>Dynamic Link Library (.dll)</strong>.</li>
</ol>
<figure class="shot">
<img src="images/l1-02-dlltype.png" alt="Windows Desktop Project application type set to DLL" onerror="this.style.display='none';this.nextElementSibling.style.display='flex';">
<div class="shot-placeholder"><span class="cam">📷</span>
<div><span class="badge">SLOT</span>Save as <code>images/l1-02-dlltype.png</code></div>
<div>The "Windows Desktop Project" dialog with Application type set to Dynamic Link Library (.dll).</div></div>
<figcaption><span class="fig">Lesson 1, Figure 2</span> — Setting the application type to DLL.</figcaption>
</figure>
<ol start="5">
<li>Leave the other options unticked and click <strong>OK</strong> to create the project.</li>
</ol>
<p>You now have an empty DLL project. On its own it knows nothing about AutoCAD — the next two steps fix
that by telling it where the ObjectARX SDK is.</p>
</section>
<section id="l1-compiler">
<h2>Step 2 — Compiler settings</h2>
<p>Open <strong>Solution Explorer</strong> (menu <strong>View → Solution Explorer</strong>, or the
shortcut <strong>Ctrl+Alt+L</strong>). Select the <code>Step01</code> project, right-click it, and choose
<strong>Properties</strong> to bring up the project's property pages. At the top, set
<strong>Configuration</strong> to <strong>All Configurations</strong> so your changes apply to both Debug
and Release.</p>
<figure class="shot">
<img src="images/l1-03-properties.png" alt="Solution Explorer, invoking project properties" onerror="this.style.display='none';this.nextElementSibling.style.display='flex';">
<div class="shot-placeholder"><span class="cam">📷</span>
<div><span class="badge">SLOT</span>Save as <code>images/l1-03-properties.png</code></div>
<div>Visual Studio Solution Explorer, right-click → Properties on the Step01 project.</div></div>
<figcaption><span class="fig">Lesson 1, Figure 3</span> — Opening the project's property pages.</figcaption>
</figure>
<ol>
<li><strong>C/C++ → General → Additional Include Directories</strong>: add the SDK's include folders, e.g.
<code>C:\ObjectARX 2027\inc</code> and <code>C:\ObjectARX 2027\inc-x64</code>. Also set
<strong>Warning Level</strong> to <strong>Level 1</strong> to hide warnings that don't matter here. Click
<strong>OK</strong> to apply and close.</li>
<li><strong>C/C++ → Code Generation → Runtime Library</strong>: choose
<strong>Multi-threaded DLL (/MD)</strong>.</li>
<li><strong>C/C++ → Preprocessor → Preprocessor Definitions</strong>: remove the <code>_DEBUG</code>
symbol if present.</li>
<li><strong>Configuration Properties → General → Platform Toolset</strong>: select <strong>v145</strong>
(the toolset that matches Visual Studio 2026 / AutoCAD 2027).</li>
</ol>
<div class="callout tip">
<p><span class="lbl">Alternative for the include/library paths.</span> Instead of the Additional Include
Directories field, you can set the same paths under <strong>Configuration Properties → VC++
Directories</strong>: use <strong>Include Directories</strong> for the SDK's <code>inc</code> folders and
<strong>Library Directories</strong> for its <code>lib-x64</code> folder.</p>
</div>
<div class="callout warn">
<p><span class="lbl">The most important rule in all of ObjectARX:</span> always use <code>/MD</code>
(Multi-threaded <em>DLL</em>) — <strong>even in Debug builds</strong>. AutoCAD itself is always a Release
program, so your plug-in must match it. Using <code>/MDd</code> causes crashes and "heap corruption."
This is why you remove <code>_DEBUG</code> above.</p>
</div>
<figure class="shot">
<img src="images/l1-04-runtime.png" alt="Runtime library /MD" onerror="this.style.display='none';this.nextElementSibling.style.display='flex';">
<div class="shot-placeholder"><span class="cam">📷</span>
<div><span class="badge">SLOT</span>Save as <code>images/l1-04-runtime.png</code></div>
<div>Code Generation → Runtime Library set to Multi-threaded DLL (/MD).</div></div>
<figcaption><span class="fig">Lesson 1, Figure 4</span> — Setting the include directories.</figcaption>
</figure>
<figure class="shot">
<img src="images/l1-05-toolset.png" alt="Platform Toolset v145" onerror="this.style.display='none';this.nextElementSibling.style.display='flex';">
<div class="shot-placeholder"><span class="cam">📷</span>
<div><span class="badge">SLOT</span>Save as <code>images/l1-05-toolset.png</code></div>
<div>General → Platform Toolset set to v145.</div></div>
<figcaption><span class="fig">Lesson 1, Figure 5</span> — Setting the Platform Toolset.</figcaption>
</figure>
</section>
<section id="l1-linker">
<h2>Step 3 — Linker settings</h2>
<ol>
<li><strong>Linker → Input → Additional Dependencies</strong>: add the core ObjectARX libraries:
<div class="code-block"><button class="copy-btn" onclick="copyCode(this)">Copy</button><pre><code>rxapi.lib;acdb26.lib;acge26.lib;acad.lib;ac1st26.lib;accore.lib</code></pre></div></li>
</ol>
<div class="callout tip">
<p><span class="lbl">About that "26" in the library names.</span> The number tracks the AutoCAD release
(2026 → 25, 2027 → 26). If a library name isn't found, open your SDK's <code>lib-x64</code> folder and use
the exact names you see there.</p>
</div>
<figure class="shot">
<img src="images/l1-06-linklibs.png" alt="Additional dependencies" onerror="this.style.display='none';this.nextElementSibling.style.display='flex';">
<div class="shot-placeholder"><span class="cam">📷</span>
<div><span class="badge">SLOT</span>Save as <code>images/l1-06-linklibs.png</code></div>
<div>Linker → Input → Additional Dependencies with the ObjectARX libraries.</div></div>
<figcaption><span class="fig">Lesson 1, Figure 6</span> — Adding the ObjectARX libraries.</figcaption>
</figure>
<ol start="2">
<li><strong>Linker → General → Additional Library Directories</strong>: add the SDK's library folder,
e.g. <code>C:\ObjectARX 2027\lib-x64</code>.</li>
<li><strong>Linker → General → Output File</strong> (or <strong>Advanced → Target File Extension</strong>):
change the output extension from <code>.dll</code> to <strong><code>.arx</code></strong>.</li>
</ol>
<figure class="shot">
<img src="images/l1-07-outputext.png" alt="Output file extension changed to .arx" onerror="this.style.display='none';this.nextElementSibling.style.display='flex';">
<div class="shot-placeholder"><span class="cam">📷</span>
<div><span class="badge">SLOT</span>Save as <code>images/l1-07-outputext.png</code></div>
<div>Additional Library Directories set, and the output file extension changed from .dll to .arx.</div></div>
<figcaption><span class="fig">Lesson 1, Figure 7</span> — Setting the library path and output extension.</figcaption>
</figure>
<p>Your project settings are now complete. Next, the actual code.</p>
</section>
<section id="l1-code">
<h2>Step 4 — Add the code</h2>
<ol>
<li>From the <strong>Project</strong> menu, choose <strong>Add New Item…</strong> (shortcut Ctrl+Shift+A).</li>
<li>In the "Add New Item" dialog, select <strong>C++ File (.cpp)</strong>.</li>
<li>Enter <strong><code>HelloWorld</code></strong> in the <strong>Name:</strong> box and click
<strong>Add</strong>.</li>
</ol>
<figure class="shot">
<img src="images/l1-08-addfile.png" alt="Adding HelloWorld.cpp" onerror="this.style.display='none';this.nextElementSibling.style.display='flex';">
<div class="shot-placeholder"><span class="cam">📷</span>
<div><span class="badge">SLOT</span>Save as <code>images/l1-08-addfile.png</code></div>
<div>The "Add New Item" dialog creating HelloWorld.cpp.</div></div>
<figcaption><span class="fig">Lesson 1, Figure 8</span> — Adding HelloWorld.cpp.</figcaption>
</figure>
<p>First, include the headers you need. <code>aced.h</code> gives access to AutoCAD's editor services;
<code>rxregsvc.h</code> declares the ObjectARX registration utilities; <code>tchar.h</code> provides the
<code>_T()</code> text macro:</p>
<div class="code-block"><button class="copy-btn" onclick="copyCode(this)">Copy</button>
<pre><code><span class="kw">#include</span> <span class="str">"pch.h"</span>
<span class="kw">#include</span> <span class="str">"tchar.h"</span>
<span class="kw">#include</span> <aced.h>
<span class="kw">#include</span> <rxregsvc.h></code></pre>
</div>
<p>Declare the three functions you'll write — one to run when AutoCAD loads the app, one when it unloads it,
and one that does the actual work:</p>
<div class="code-block"><button class="copy-btn" onclick="copyCode(this)">Copy</button>
<pre><code><span class="kw">void</span> initApp();
<span class="kw">void</span> unloadApp();
<span class="kw">void</span> helloWorld();</code></pre>
</div>
<p><code>initApp()</code> registers a new command with AutoCAD. Registering a command gives AutoCAD a new
"entry point" into your app — the word the user types:</p>
<div class="code-block"><button class="copy-btn" onclick="copyCode(this)">Copy</button>
<pre><code><span class="kw">void</span> initApp()
{
<span class="cm">// register a command with the AutoCAD command mechanism</span>
acedRegCmds->addCommand(_T(<span class="str">"HELLOWORLD_COMMANDS"</span>),
_T(<span class="str">"Hello"</span>), <span class="cm">// global (untranslated) name</span>
_T(<span class="str">"Bonjour"</span>), <span class="cm">// local (translated) name</span>
ACRX_CMD_TRANSPARENT,
helloWorld); <span class="cm">// function to call</span>
}</code></pre>
</div>
<p>The arguments are: the command <em>group</em> name, the global command name, the localized name, a flag
(<code>ACRX_CMD_TRANSPARENT</code> means it can run while another command is active), and the function to
call when the command runs.</p>
<p><code>unloadApp()</code> removes that command group when AutoCAD unloads the app — you must clean up the
entry points you added:</p>
<div class="code-block"><button class="copy-btn" onclick="copyCode(this)">Copy</button>
<pre><code><span class="kw">void</span> unloadApp()
{
acedRegCmds->removeGroup(_T(<span class="str">"HELLOWORLD_COMMANDS"</span>));
}</code></pre>
</div>
<p><code>helloWorld()</code> is the command itself. <code>acutPrintf()</code> is ObjectARX's version of C's
<code>printf</code>, aimed at the AutoCAD command line:</p>
<div class="code-block"><button class="copy-btn" onclick="copyCode(this)">Copy</button>
<pre><code><span class="kw">void</span> helloWorld()
{
acutPrintf(_T(<span class="str">"\nHello World!"</span>));
}</code></pre>
</div>
<p>Finally, the single most important function in any ObjectARX app: <strong><code>acrxEntryPoint()</code></strong>.
Because a plug-in is a DLL (it has no <code>main()</code>), AutoCAD calls this function to send it messages —
"you are being loaded," "you are being unloaded," and so on:</p>
<div class="code-block"><button class="copy-btn" onclick="copyCode(this)">Copy</button>
<pre><code><span class="kw">extern</span> <span class="str">"C"</span> AcRx::AppRetCode
acrxEntryPoint(AcRx::AppMsgCode msg, <span class="kw">void</span>* pkt)
{
<span class="kw">switch</span> (msg)
{
<span class="kw">case</span> AcRx::kInitAppMsg:
acrxDynamicLinker->unlockApplication(pkt); <span class="cm">// allow unloading</span>
acrxRegisterAppMDIAware(pkt);
initApp();
<span class="kw">break</span>;
<span class="kw">case</span> AcRx::kUnloadAppMsg:
unloadApp();
<span class="kw">break</span>;
<span class="kw">default</span>:
<span class="kw">break</span>;
}
<span class="kw">return</span> AcRx::kRetOK;
}</code></pre>
</div>
<p>When AutoCAD loads the app (<code>kInitAppMsg</code>), unlock it so it can be unloaded later, mark it
MDI-aware, and register the command. When AutoCAD unloads the app (<code>kUnloadAppMsg</code>), remove the
command.</p>
</section>
<section id="l1-def">
<h2>Step 5 — The .def file</h2>
<p>AutoCAD can only find <code>acrxEntryPoint()</code> if the DLL <em>exports</em> it. The simplest way is a
module definition (<code>.def</code>) file.</p>
<ol>
<li>From the <strong>Project</strong> menu, choose <strong>Add New Item…</strong> (Ctrl+Shift+A).</li>
<li>In the "Add New Item" dialog, select <strong>Module-Definition File (.def)</strong>.</li>
<li>Enter <strong><code>ArxProject</code></strong> in the <strong>Name:</strong> box and click
<strong>Open</strong>.</li>
</ol>
<p>Clear any auto-generated content and add the following to the new file. Every ObjectARX application must export at least these two functions —
<code>acrxEntryPoint</code> and <code>acrxGetApiVersion</code>:</p>
<div class="code-block"><button class="copy-btn" onclick="copyCode(this)">Copy</button>
<pre><code>EXPORTS
acrxEntryPoint PRIVATE
acrxGetApiVersion PRIVATE</code></pre>
</div>
<div class="callout tip">
<p><span class="lbl">Note.</span> You may see linker warning <code>LNK4099</code> for some libraries during the
build. It's harmless here — you can ignore it.</p>
</div>
</section>
<section id="l1-run">
<h2>Step 6 — Build & run</h2>
<p>Set the configuration to <strong>x64</strong> and build with <strong>Build → Build Solution</strong>
(Ctrl+Shift+B). If you followed along, you'll get <strong>0 errors</strong> and your plug-in appears as
<code>Step01.arx</code> in the project's <code>x64</code> output folder.</p>
<p>Now load and run it in AutoCAD. Start AutoCAD 2027, open any drawing, and load
<code>Step01.arx</code> using any of these methods:</p>
<ol>
<li>Drag the file from Windows Explorer into the AutoCAD window.</li>
<li>Use the AutoCAD <strong><code>ARX</code></strong> command's <strong>Load</strong> option at the command
line.</li>
<li>From the <strong>Tools</strong> menu, choose <strong>Load Application…</strong>.</li>
<li>Type <strong><code>APPLOAD</code></strong>, browse to <code>Step01.arx</code>, and click <strong>Load</strong>.</li>
</ol>
<p>Once loaded, type <strong><code>HELLO</code></strong> and press Enter. You'll see
<code>Hello World!</code> printed on the command line. (Typing <code>BONJOUR</code> works too — that was
the localized name.)</p>
<figure class="shot">
<img src="images/l1-09-hello.png" alt="HELLO output in AutoCAD" onerror="this.style.display='none';this.nextElementSibling.style.display='flex';">
<div class="shot-placeholder"><span class="cam">📷</span>
<div><span class="badge">SLOT</span>Save as <code>images/l1-09-hello.png</code></div>
<div>The AutoCAD command line showing "Hello World!" after running HELLO.</div></div>
<figcaption><span class="fig">Lesson 1, Figure 9</span> — Your first ObjectARX command running.</figcaption>
</figure>
<p>That's a complete ObjectARX application, built entirely by hand. Notice how much of the work was
<em>settings and plumbing</em>, not your actual idea. Lesson 2 removes that busywork. Stuck anywhere above?
Compare with the solved project: <a href="Solutions/Lesson1_Solved.zip" download>Solutions\Lesson1_Solved.zip</a>.</p>
<div class="next">▶ Next: <a href="#l2-intro">Lesson 2 — Do it faster with Claude Code</a></div>
</section>
<!-- ============ LESSON 2 ============ -->
<section id="l2-intro">
<div class="band">
<div class="kicker">Lesson 2 · The fast path</div>
<h1>Do It Faster with Claude Code</h1>
</div>
<p>As you just saw, creating an ObjectARX application by hand is a lot of careful clicking. In this lesson
you'll get the same kind of project in seconds using <strong>Claude Code</strong> and a ready-made
<strong>wizard skill</strong>.</p>
<div class="callout tip">
<p><span class="lbl">We won't repeat Lesson 1 here.</span> The ObjectARX ideas — commands,
<code>acrxEntryPoint()</code>, <code>/MD</code>, the <code>.arx</code> output — are exactly the same. This
lesson focuses only on the <em>tools</em> and on what the generated project gives you <em>on top of</em>
the hand-built one.</p>
</div>
</section>
<section id="l2-claude">
<h2>Step 1 — What is Claude Code, and how to install it</h2>
<p><strong>Claude Code</strong> is an AI assistant that runs in your terminal. Unlike a chat window, it can
actually work on your computer — read and write files, run commands, and build projects — while asking
your permission before anything risky. You tell it what you want in plain English and it does the steps.</p>
<h3>Install it</h3>
<ol>
<li>Open <strong>PowerShell</strong> (press the Windows key, type <em>PowerShell</em>, Enter).</li>
<li>Install Claude Code using the official native installer — no Node.js required, and it keeps itself
updated automatically:
<div class="code-block"><button class="copy-btn" onclick="copyCode(this)">Copy</button><pre><code>irm https://claude.ai/install.ps1 | iex</code></pre></div></li>
</ol>
<ol start="3">
<li>Move into a working folder and start it by typing <code>claude</code>:
<div class="code-block"><button class="copy-btn" onclick="copyCode(this)">Copy</button><pre><code>cd C:\Users\you\source\repos
claude</code></pre></div>
The first time, it will walk you through signing in.</li>
</ol>
<figure class="shot">
<img src="images/l2-01-install.png" alt="Native installer running in PowerShell" onerror="this.style.display='none';this.nextElementSibling.style.display='flex';">
<div class="shot-placeholder"><span class="cam">📷</span>
<div><span class="badge">SLOT</span>Save as <code>images/l2-01-install.png</code></div>
<div>The native installer downloading and installing Claude Code in PowerShell.</div></div>
<figcaption><span class="fig">Lesson 2, Figure 1</span> — Running the native installer.</figcaption>
</figure>
<figure class="shot">
<img src="images/l2-02-claude.png" alt="Claude Code running" onerror="this.style.display='none';this.nextElementSibling.style.display='flex';">
<div class="shot-placeholder"><span class="cam">📷</span>
<div><span class="badge">SLOT</span>Save as <code>images/l2-02-claude.png</code></div>
<div>Claude Code started in the terminal after typing <code>claude</code>.</div></div>
<figcaption><span class="fig">Lesson 2, Figure 2</span> — Claude Code running in PowerShell.</figcaption>
</figure>
<div class="callout tip">
<p><span class="lbl">Prefer npm?</span> <code>npm install -g @anthropic-ai/claude-code</code> still works and
installs the same tool, but it requires Node.js 22+ and doesn't auto-update — you'd run
<code>claude update</code> yourself. The native installer above is Anthropic's recommended method.</p>
</div>
<div class="callout tip">
<p><span class="lbl">Two handy habits inside Claude Code:</span> commands that start with <code>/</code> (a
"slash command") run a skill; and a line that starts with <code>!</code> runs a shell command yourself, e.g.
<code>!dir</code>.</p>
</div>
</section>
<section id="l2-skill">
<h2>Step 2 — Get the ObjectARX wizard skill</h2>
<p>A <strong>skill</strong> is a small folder of instructions and scripts that teaches Claude Code how to do
a specialized task well. Think of it as a plug-in for the assistant. When a skill is installed, you trigger
it with a slash command.</p>
<p>The one you want is <strong><code>acad-arx-wizard</code></strong>. It replaces the old (and, in Visual
Studio 2026, broken) ObjectARX project wizard with scripts that generate the same project files.</p>
<h3>Install the skill</h3>
<ol>
<li>Open the skill in your browser:
<a href="https://github.com/autodesk-platform-services/skills/tree/main/skills/acad-arx-wizard">github.com/autodesk-platform-services/skills → skills/acad-arx-wizard</a>. Go through its
<a href="https://github.com/autodesk-platform-services/skills/tree/main/skills/acad-arx-wizard#readme">README file</a> in detail to understand what it does before installing it.</li>
<li>Download that repository (green <strong>Code → Download ZIP</strong> button) and unzip it.</li>
<li>Copy the <code>acad-arx-wizard</code> folder into your personal Claude Code skills folder:
<div class="code-block"><button class="copy-btn" onclick="copyCode(this)">Copy</button><pre><code>C:\Users\<you>\.claude\skills\acad-arx-wizard</code></pre></div>
That folder is exactly where this skill is installed on this machine.</li>
<li>Windows blocks PowerShell scripts by default, and every wizard action runs one. In PowerShell, run this
once to allow locally-installed scripts:
<div class="code-block"><button class="copy-btn" onclick="copyCode(this)">Copy</button><pre><code>Set-ExecutionPolicy -Scope CurrentUser RemoteSigned</code></pre></div></li>
<li>Start (or restart) Claude Code. Type <code>/</code> and you should see <code>acad-arx-wizard</code> in the
list of available skills.</li>
</ol>
<div class="callout tip">
<p><span class="lbl">How to tell it worked:</span> inside Claude Code, run <code>/acad-arx-wizard</code>. If the
skill is installed, Claude greets you and asks which kind of project or class you want.</p>
</div>
<div class="callout tip">
<p><span class="lbl">Faster install, if you already have Node.js.</span> The skill's repository also supports
installing it with a single command instead of the manual download-and-copy above:
<code>npx skills add autodesk-platform-services/skills --global --skill acad-arx-wizard</code>. This needs
Node.js v16.7+ (for the install only) — the manual method above works without it.</p>
</div>
<figure class="shot">
<img src="images/l2-03-skill.png" alt="Skill folder installed" onerror="this.style.display='none';this.nextElementSibling.style.display='flex';">
<div class="shot-placeholder"><span class="cam">📷</span>
<div><span class="badge">SLOT</span>Save as <code>images/l2-03-skill.png</code></div>
<div>The <code>acad-arx-wizard</code> folder inside <code>.claude\skills</code>, or the slash-command list.</div></div>
<figcaption><span class="fig">Lesson 2, Figure 3</span> — The wizard skill installed.</figcaption>
</figure>
<h3>Good to know about the skill</h3>
<div class="callout tip">
<p><span class="lbl">Why this skill exists.</span> The classic <code>.vsz</code> /
<code>VsWizardEngine</code> wizard (<em>File → New → ObjectARX</em>) is broken in Visual Studio 2026 — a
known VS regression (see
<a href="https://developercommunity.visualstudio.com/t/VsWizardVsWizardEngine-vsz-based-projec/11071541">MS
Developer Community #11071541</a>). This skill replaces it for AutoCAD 2027 / VS 2026, running the same kind
of generator, so what you get is a <strong>normal, standard ObjectARX project</strong>. VS 2022 isn't affected by this bug; if
you're on VS 2022 you can keep using the original
<a href="https://github.com/ADN-DevTech/ObjectARX-Wizards">ObjectARX-Wizards installer</a> instead.</p>
<p><span class="lbl">It's safe.</span> The skill only writes files into the folder you choose, and Claude
Code asks your permission before running anything. It doesn't touch AutoCAD's settings; the one-time
PowerShell execution-policy change in Step 2 above is the only Windows-level change, and it's limited to
your user account.</p>
</div>
<h3>Which project type? arx vs dbx vs crx</h3>
<p>When you ask for a project, the skill can make three kinds. For your first plug-ins you want
<strong>arx</strong>.</p>
<table>
<thead><tr><th>Type</th><th>Runs where</th><th>Use it when…</th></tr></thead>
<tbody>
<tr><td><strong>arx</strong></td><td>Inside AutoCAD (with its UI)</td><td>…almost always — commands, drawing, reacting to the user. <em>Start here.</em></td></tr>
<tr><td><strong>dbx</strong></td><td>No AutoCAD UI (RealDWG / object module)</td><td>…you're defining custom objects meant to be shared by other modules.</td></tr>
<tr><td><strong>crx</strong></td><td>The headless console (<code>accoreconsole.exe</code>)</td><td>…you need batch/automation with no user interface.</td></tr>
</tbody>
</table>
<h3>What you can ask for</h3>
<p>The simple prompt in the next step is enough to start, but the skill accepts more options — just mention
them in plain English:</p>
<ul>
<li><strong>Project name</strong> and <strong>location</strong> (required).</li>
<li><strong>Project type</strong> — <code>arx</code>, <code>dbx</code>, or <code>crx</code> (default <code>arx</code>).</li>
<li><strong>MFC</strong> — <code>none</code>, <code>shared</code>, or <code>ext</code> (for dialogs/palettes; default <code>none</code>).</li>
<li><strong>ATL/COM</strong> or <strong>.NET/CLR</strong> support, if you plan to expose your code that way.</li>
<li><strong>RDS prefix</strong> — a short unique tag (default <code>Adsk</code>) added to your names so they
don't clash with other developers' plug-ins.</li>
</ul>
<p>For example: <em>"create a dbx project called Shapes with RDS prefix Xyz."</em></p>
<div class="callout tip">
<p><span class="lbl">Under the hood (and when things go wrong).</span> A skill is just a folder you can open:
<code>SKILL.md</code> (instructions), <code>scripts/</code> (the generators), <code>templates/</code>, and
<code>docs/</code>. Two of those docs are worth knowing about — <code>docs/arx-dev-guide.md</code> explains
the build settings, and <code>docs/learnings.md</code> collects real-world build/link gotchas. If a build
ever fails, check there before panicking. To update the skill, re-download its folder from the GitHub repo.</p>
</div>
</section>
<section id="l2-create">
<h2>Step 3 — Scaffold the project</h2>
<p>Now let Claude Code build the project. In the Claude Code prompt, just describe what you want in plain
English:</p>
<div class="code-block"><button class="copy-btn" onclick="copyCode(this)">Copy</button><pre><code>/acad-arx-wizard
create a simple ObjectARX project called HelloArx</code></pre></div>
<p>Claude first works out which of the skill's wizards you mean — here, "create a project" maps to the
full-project wizard, not one of the add-on class wizards from Step 5 below. It then asks only for the pieces
it can't guess — a <strong>project name</strong> and a <strong>location</strong> — since everything else
(app type, MFC mode, RDS prefix) has a sensible default unless you say otherwise. Once it has what it needs,
it runs the wizard script. Behind the scenes it executes a single PowerShell command (you don't have to
type it):</p>
<div class="code-block"><button class="copy-btn" onclick="copyCode(this)">Copy</button><pre><code>powershell.exe -ExecutionPolicy Bypass -NoProfile -File "<skill-root>\scripts\New-ArxApp.ps1" `
-ProjectName HelloArx -OutputPath "C:\Dev" -AppType arx -MfcMode none</code></pre></div>
<p>In a couple of seconds it reports something like:</p>
<div class="code-block"><button class="copy-btn" onclick="copyCode(this)">Copy</button><pre><code>Done. Generated 13 files in: C:\Dev\HelloArx
StdAfx.cpp
StdAfx.h
acrxEntryPoint.cpp
Resource.h
root.rc
ReadMe.txt
DocData.cpp
DocData.h
HelloArx.cpp
HelloArx.vcxproj
Autodesk.arx-2027.props
Autodesk.arx-2027-net.props
crx.props
Next steps:
1. Open HelloArx.vcxproj in Visual Studio 2026
2. Verify the ObjectARX SDK path in Autodesk.arx-2027.props
3. Build -> x64 Debug</code></pre></div>
<figure class="shot">
<img src="images/l2-04-generated.png" alt="Generated project" onerror="this.style.display='none';this.nextElementSibling.style.display='flex';">
<div class="shot-placeholder"><span class="cam">📷</span>
<div><span class="badge">SLOT</span>Save as <code>images/l2-04-generated.png</code></div>
<div>The wizard's "Done. Generated 13 files" output, or the new project folder.</div></div>
<figcaption><span class="fig">Lesson 2, Figure 4</span> — The generated project.</figcaption>
</figure>
<p>Compare that to Lesson 1: no manual include paths, no linker list, no <code>.def</code> file, no
<code>/MD</code> hunting. The wizard set all of it correctly for AutoCAD 2027.</p>
</section>
<section id="l2-more">
<h2>Step 4 — What the skill's project gives you (beyond Lesson 1)</h2>
<p>The hand-built project in Lesson 1 was deliberately bare. The generated <code>HelloArx</code> project is a
more realistic starting point. The extras worth knowing about:</p>
<table>
<thead><tr><th>What you get</th><th>Why it helps</th></tr></thead>
<tbody>
<tr><td><strong>An app <em>class</em></strong> (<code>CHelloArxApp</code>) instead of loose functions</td>
<td>ObjectARX's modern C++ style. Load/unload handling lives in tidy member functions instead of a big <code>switch</code>.</td></tr>
<tr><td><strong>Auto-registered commands</strong> via the <code>ACED_ARXCOMMAND_ENTRY_AUTO(...)</code> macro</td>
<td>No more writing <code>initApp()</code>/<code>unloadApp()</code> by hand — add a function, add one macro line, done.</td></tr>
<tr><td><strong>A precompiled header</strong> (<code>StdAfx.h</code> pulling in <code>arxHeaders.h</code>)</td>
<td>You get <em>all</em> ObjectARX headers at once, and builds are much faster.</td></tr>
<tr><td><strong>Property sheets</strong> (<code>Autodesk.arx-2027.props</code>) instead of hand-typed settings</td>
<td>All the SDK paths, <code>/MD</code>, C++17, and the <code>.arx</code> extension are set for you and easy to edit in one place.</td></tr>
<tr><td><strong>A <code>DocData</code> class + DLL plumbing</strong></td>
<td>Ready-made spots for per-drawing data and the standard COM/DLL entry points — there when you grow beyond "hello."</td></tr>
</tbody>
</table>
<p>In short: the generated project already has everything Lesson 1 set up by hand, plus the extras above. To
add your own command you now just write a function and register it with one macro line:</p>
<div class="code-block"><button class="copy-btn" onclick="copyCode(this)">Copy</button><pre><code><span class="kw">static</span> <span class="kw">void</span> AdskMyGroupHello()
{
acutPrintf(ACRX_T(<span class="str">"\nHello, ObjectARX!"</span>));
}
<span class="cm">// ...and at the bottom of the file:</span>
ACED_ARXCOMMAND_ENTRY_AUTO(CHelloArxApp, AdskMyGroup, Hello, Hello, ACRX_CMD_MODAL, NULL)</code></pre></div>
<div class="callout tip">
<p><span class="lbl">Naming rule (same idea as Lesson 1).</span> The function name is the command
<em>group</em> + the command <em>name</em>: group <code>AdskMyGroup</code> + command <code>Hello</code>
→ <code>AdskMyGroupHello</code>.</p>
</div>
</section>
<section id="l2-addons">
<h2>Step 5 — Add-on class wizards (beyond a full project)</h2>
<p>Creating a whole project — what you just did — is only one of the things the skill can do. The same
<code>acad-arx-wizard</code> skill can also add ready-made <strong>class files</strong> to an existing
project: the ObjectARX building blocks you'll reach for as you grow. You don't run a separate tool — you
just ask Claude Code in plain English, and it drops the generated <code>.h</code>/<code>.cpp</code> files
into your project folder for you to include (right-click the project → <strong>Add → Existing Item</strong>).</p>
<p>Here are the add-ons in plain terms. You don't need to understand them fully yet — just know they exist.</p>
<table>
<thead><tr><th>Add-on</th><th>What it's for (beginner view)</th><th>Say something like…</th></tr></thead>
<tbody>
<tr><td><strong>Custom Object</strong></td><td>Your own kind of object stored in the drawing — a subclass of <code>AcDbEntity</code>.</td><td><em>"add a custom object called AdskEmployee"</em></td></tr>
<tr><td><strong>Reactor</strong></td><td>Code that <em>reacts</em> to events — runs when an object is modified, or the drawing/database changes.</td><td><em>"add a database reactor to HelloArx"</em></td></tr>
<tr><td><strong>Jig</strong></td><td>Interactive dragging — lets the user drag and preview an object with the mouse before placing it.</td><td><em>"add a jig for placing a line"</em></td></tr>
<tr><td><strong>MFC dialog / palette</strong></td><td>A user-interface window — a dialog box, tool palette, or dockable panel.</td><td><em>"add an MFC dialog"</em></td></tr>
<tr><td><strong>.NET wrapper</strong></td><td>Lets .NET (C#) code call into your C++ object — a managed C++/CLI wrapper.</td><td><em>"add a .NET wrapper for my custom object"</em></td></tr>
<tr><td><strong>COM wrapper</strong></td><td>Exposes your object to COM/automation clients such as VBA or scripting.</td><td><em>"add a COM wrapper object"</em></td></tr>
<tr><td><strong>Dynamic property</strong></td><td>Adds runtime ("dynamic") properties to objects, similar to dynamic-block parameters.</td><td><em>"add a dynamic property class"</em></td></tr>
</tbody>
</table>
<div class="callout tip">
<p><span class="lbl">You don't need these yet.</span> For your first commands the full project is all you need.
Come back to this list when you're ready to store custom data (<strong>Custom Object</strong>), respond to
events (<strong>Reactor</strong>), let users drag geometry (<strong>Jig</strong>), or add a UI
(<strong>MFC</strong>). Each one is a single request away.</p>
</div>
</section>
<section id="l2-run">
<h2>Step 6 — Build & run</h2>
<ol>
<li>Open <code>HelloArx.vcxproj</code> in Visual Studio 2026.</li>
<li>If your SDK/AutoCAD live in non-default folders, open <code>Autodesk.arx-2027.props</code> and fix the
<code>ArxSdkDir</code> and <code>AcadDir</code> lines.</li>
</ol>
<div class="callout warn">
<p><span class="lbl">Heads up — a build error can show up here.</span> The generated
<code>Autodesk.arx-2027.props</code> ships with a placeholder <code>ArxSdkDir</code>
(<code>C:\ObjectARX\</code>). If you skip the fix in point 2 above, Build Solution fails with something
like:</p>
<div class="code-block"><button class="copy-btn" onclick="copyCode(this)">Copy</button><pre><code>MSB4019: The imported project "C:\ObjectARX\inc\arx.props" was not found. Confirm that the
expression in the Import declaration "$(ArxSdkDir)\inc\arx.props", which evaluated to
"C:\ObjectARX\\inc\arx.props", is correct, and that the file exists on disk.</code></pre></div>
</div>
<figure class="shot">
<img src="images/l2-05b-sdkerror.png" alt="MSB4019 ArxSdkDir not found error" onerror="this.style.display='none';this.nextElementSibling.style.display='flex';">
<div class="shot-placeholder"><span class="cam">📷</span>
<div><span class="badge">SLOT</span>Save as <code>images/l2-05b-sdkerror.png</code></div>
<div>The MSB4019 error in Visual Studio's Error List, complaining that "C:\ObjectARX\inc\arx.props" was not found.</div></div>
<figcaption><span class="fig">Lesson 2, Figure 5b</span> — The ArxSdkDir placeholder error.</figcaption>
</figure>
<p>If you hit this, you don't need to hand-edit the props file yourself — just tell Claude Code where your
real SDK lives and let it make the fix. In the Claude Code prompt, paste the error and say something like:</p>
<div class="code-block"><button class="copy-btn" onclick="copyCode(this)">Copy</button><pre><code>I got this build error: [paste the MSB4019 error above].
My ObjectARX 2027 SDK is actually installed at C:\Work\arxsdk\2027 — update the
ArxSdkDir path in Autodesk.arx-2027.props to match.</code></pre></div>
<p>Claude Code will check that the folder you give it actually contains <code>arx.props</code>,
<code>inc-x64</code>, and <code>lib-x64</code>, then update the <code>ArxSdkDir</code> line for you.</p>
<ol start="3">
<li>Build <strong>x64 Debug</strong> (Ctrl+Shift+B). The output is
<code>x64\Debug\AdskHelloArx.arx</code>.</li>
<li>In AutoCAD: <code>APPLOAD</code> that file, then type <code>MYCOMMAND</code>.</li>
</ol>
<div class="callout tip">
<p><span class="lbl">Why <code>MYCOMMAND</code> and not <code>HELLO</code>.</span> Unlike Lesson 1's
hand-written project, the wizard's <code>acrxEntryPoint.cpp</code> doesn't ship a command literally named
<code>HELLO</code>. It ships three <strong>stub</strong> commands with empty bodies —
<code>MYCOMMAND</code>, <code>MYPICKFIRST</code>, and <code>MYSESSIONCMD</code> — plus a stub Lisp function,
all placeholders for you to fill in (look for <code>AdskMyGroupMyCommand</code> in the file). Typing
<code>MYCOMMAND</code> at the command line is the real smoke test here: it confirms the <code>.arx</code>
loaded, <code>On_kInitAppMsg</code> ran, and the command table registered and dispatched correctly — even
though the stub itself does nothing visible yet.</p>
</div>
<p>If <code>MYCOMMAND</code> runs with no errors (AutoCAD just returns to a blank command line), the plug-in
loaded and works — same underlying proof as Lesson 1's <code>HELLO</code>, you just don't get a printed
message yet, because the stub body is empty.</p>
<div class="callout tip">
<p><span class="lbl">Want to actually see something happen?</span> Ask Claude Code to fill in the stub. In
the Claude Code prompt:</p>
<div class="code-block"><button class="copy-btn" onclick="copyCode(this)">Copy</button><pre><code>Add a print statement to the MYCOMMAND stub (AdskMyGroupMyCommand) in acrxEntryPoint.cpp using
acutPrintf, then rebuild HelloArx and tell me how to test it.</code></pre></div>
<p>Claude will edit the function body — typically something like:</p>
<div class="code-block"><button class="copy-btn" onclick="copyCode(this)">Copy</button><pre><code><span class="kw">static</span> <span class="kw">void</span> AdskMyGroupMyCommand()
{
acutPrintf(ACRX_T(<span class="str">"\nHello from HelloArx!"</span>));
}</code></pre></div>
<p>then rebuild the project and hand you back the <code>APPLOAD</code> + <code>MYCOMMAND</code> steps to
confirm it. (Note it uses <code>ACRX_T</code>, not Lesson 1's <code>_T</code> — this project has no
<code>tchar.h</code>/MFC include pulling <code>_T</code> in.)</p>
</div>
<figure class="shot">
<img src="images/l2-05-hello.png" alt="MYCOMMAND from the generated project" onerror="this.style.display='none';this.nextElementSibling.style.display='flex';">
<div class="shot-placeholder"><span class="cam">📷</span>
<div><span class="badge">SLOT</span>Save as <code>images/l2-05-hello.png</code></div>
<div>The MYCOMMAND command running from the wizard-generated plug-in.</div></div>
<figcaption><span class="fig">Lesson 2, Figure 5</span> — The generated plug-in running in AutoCAD.</figcaption>
</figure>
<div class="callout tip">
<p><span class="lbl">Debug tip.</span> The property sheet already points the debugger at AutoCAD, so pressing
<strong>F5</strong> launches AutoCAD with the debugger attached. <code>APPLOAD</code> your <code>.arx</code>,
set a breakpoint, run <code>MYCOMMAND</code>, and step through your code.</p>
</div>
<div class="next">▶ Next: <a href="#l3-intro">Lesson 3 — Getting input and selecting entities</a></div>
</section>
<!-- ============ LESSON 3 ============ -->
<section id="l3-intro">
<div class="band">
<div class="kicker">Lesson 3 · Talking to the user</div>
<h1>Getting Input & Selecting Entities</h1>
</div>
<p>So far your commands just printed a message. Real commands <em>ask the user for something</em> — a
number, a choice, a point, or an object in the drawing. In this lesson you'll add two commands to the
<code>HelloArx</code> project from Lesson 2 and learn ObjectARX's input and selection functions.</p>
<p><span class="lbl">Objectives</span></p>
<ol>
<li><strong><code>MYINPUT</code></strong> — demonstrate input functions:
<ol type="a">
<li>Ask for an integer, but <strong>disallow negative and zero</strong> values.</li>
<li>Ask for a real number, but also accept the keywords <code>PI</code>, <code>A</code>, <code>B</code>,
<code>C</code> — defaulting to <code>C</code> if the user just presses <strong>Enter</strong>. The value
becomes 3.14 for <code>PI</code>, 10.0 for <code>A</code>, 11.0 for <code>B</code>, 12.0 for <code>C</code>.</li>
<li>Handle the user pressing <strong>Esc</strong> gracefully.</li>
<li>Print the integer and the real value on the command line.</li>
</ol>
</li>
<li><strong><code>MYSELECT</code></strong> — demonstrate entity selection:
<ol type="a">
<li>Ask the user to select a single entity.</li>
<li>If one is selected, show its Object ID (the first element of the returned <code>ads_name</code> data type).</li>
</ol>
</li>
</ol>
<h3>The functions you'll use</h3>
<p>ObjectARX gives you a family of <code>acedGetXxx</code> input functions and a set of selection functions.