@mlightcad/cad-simple-viewer 1.7.8-preview.0 → 1.7.8-preview.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +190 -190
- package/dist/cad-simple-viewer.js +10120 -8596
- package/dist/cad-simple-viewer.umd.cjs +82 -82
- package/find.ts +7 -7
- package/icons.ts +7 -7
- package/lib/app/AcApContext.d.ts.map +1 -1
- package/lib/app/AcApContext.js +10 -1
- package/lib/app/AcApContext.js.map +1 -1
- package/lib/app/AcApDocManager.d.ts.map +1 -1
- package/lib/app/AcApDocManager.js +28 -2
- package/lib/app/AcApDocManager.js.map +1 -1
- package/lib/command/AcApObjectScaleCmd.d.ts +12 -0
- package/lib/command/AcApObjectScaleCmd.d.ts.map +1 -0
- package/lib/command/AcApObjectScaleCmd.js +193 -0
- package/lib/command/AcApObjectScaleCmd.js.map +1 -0
- package/lib/command/AcApSysVarCmd.d.ts.map +1 -1
- package/lib/command/AcApSysVarCmd.js +2 -0
- package/lib/command/AcApSysVarCmd.js.map +1 -1
- package/lib/command/draw/AcApDimAlignedCmd.d.ts +21 -0
- package/lib/command/draw/AcApDimAlignedCmd.d.ts.map +1 -0
- package/lib/command/draw/AcApDimAlignedCmd.js +218 -0
- package/lib/command/draw/AcApDimAlignedCmd.js.map +1 -0
- package/lib/command/draw/AcApDimAngularCmd.d.ts +27 -0
- package/lib/command/draw/AcApDimAngularCmd.d.ts.map +1 -0
- package/lib/command/draw/AcApDimAngularCmd.js +264 -0
- package/lib/command/draw/AcApDimAngularCmd.js.map +1 -0
- package/lib/command/draw/AcApDimArcCmd.d.ts +26 -0
- package/lib/command/draw/AcApDimArcCmd.d.ts.map +1 -0
- package/lib/command/draw/AcApDimArcCmd.js +184 -0
- package/lib/command/draw/AcApDimArcCmd.js.map +1 -0
- package/lib/command/draw/AcApDimBlockUtil.d.ts +40 -0
- package/lib/command/draw/AcApDimBlockUtil.d.ts.map +1 -0
- package/lib/command/draw/AcApDimBlockUtil.js +290 -0
- package/lib/command/draw/AcApDimBlockUtil.js.map +1 -0
- package/lib/command/draw/AcApDimChainUtil.d.ts +13 -0
- package/lib/command/draw/AcApDimChainUtil.d.ts.map +1 -0
- package/lib/command/draw/AcApDimChainUtil.js +140 -0
- package/lib/command/draw/AcApDimChainUtil.js.map +1 -0
- package/lib/command/draw/AcApDimCmdUtil.d.ts +22 -0
- package/lib/command/draw/AcApDimCmdUtil.d.ts.map +1 -0
- package/lib/command/draw/AcApDimCmdUtil.js +125 -0
- package/lib/command/draw/AcApDimCmdUtil.js.map +1 -0
- package/lib/command/draw/AcApDimContinueCmd.d.ts +13 -0
- package/lib/command/draw/AcApDimContinueCmd.d.ts.map +1 -0
- package/lib/command/draw/AcApDimContinueCmd.js +204 -0
- package/lib/command/draw/AcApDimContinueCmd.js.map +1 -0
- package/lib/command/draw/AcApDimDiameterCmd.d.ts +27 -0
- package/lib/command/draw/AcApDimDiameterCmd.d.ts.map +1 -0
- package/lib/command/draw/AcApDimDiameterCmd.js +204 -0
- package/lib/command/draw/AcApDimDiameterCmd.js.map +1 -0
- package/lib/command/draw/AcApDimLinearCmd.d.ts +10 -13
- package/lib/command/draw/AcApDimLinearCmd.d.ts.map +1 -1
- package/lib/command/draw/AcApDimLinearCmd.js +161 -97
- package/lib/command/draw/AcApDimLinearCmd.js.map +1 -1
- package/lib/command/draw/AcApDimOrdinateCmd.d.ts +22 -0
- package/lib/command/draw/AcApDimOrdinateCmd.d.ts.map +1 -0
- package/lib/command/draw/AcApDimOrdinateCmd.js +186 -0
- package/lib/command/draw/AcApDimOrdinateCmd.js.map +1 -0
- package/lib/command/draw/AcApDimRadiusCmd.d.ts +28 -0
- package/lib/command/draw/AcApDimRadiusCmd.d.ts.map +1 -0
- package/lib/command/draw/AcApDimRadiusCmd.js +206 -0
- package/lib/command/draw/AcApDimRadiusCmd.js.map +1 -0
- package/lib/command/draw/index.d.ts +9 -0
- package/lib/command/draw/index.d.ts.map +1 -1
- package/lib/command/draw/index.js +9 -0
- package/lib/command/draw/index.js.map +1 -1
- package/lib/command/index.d.ts +1 -0
- package/lib/command/index.d.ts.map +1 -1
- package/lib/command/index.js +1 -0
- package/lib/command/index.js.map +1 -1
- package/lib/i18n/ar/command.d.ts +34 -0
- package/lib/i18n/ar/command.d.ts.map +1 -1
- package/lib/i18n/ar/command.js +1 -1
- package/lib/i18n/ar/command.js.map +1 -1
- package/lib/i18n/ar/jig.d.ts +244 -0
- package/lib/i18n/ar/jig.d.ts.map +1 -1
- package/lib/i18n/ar/jig.js +1 -1
- package/lib/i18n/ar/jig.js.map +1 -1
- package/lib/i18n/cs/command.d.ts +24 -0
- package/lib/i18n/cs/command.d.ts.map +1 -1
- package/lib/i18n/cs/command.js +24 -0
- package/lib/i18n/cs/command.js.map +1 -1
- package/lib/i18n/cs/jig.d.ts +221 -0
- package/lib/i18n/cs/jig.d.ts.map +1 -1
- package/lib/i18n/cs/jig.js +21 -5
- package/lib/i18n/cs/jig.js.map +1 -1
- package/lib/i18n/en/command.d.ts +34 -0
- package/lib/i18n/en/command.d.ts.map +1 -1
- package/lib/i18n/en/command.js +34 -0
- package/lib/i18n/en/command.js.map +1 -1
- package/lib/i18n/en/jig.d.ts +244 -0
- package/lib/i18n/en/jig.d.ts.map +1 -1
- package/lib/i18n/en/jig.js +147 -3
- package/lib/i18n/en/jig.js.map +1 -1
- package/lib/i18n/tr/command.d.ts +24 -0
- package/lib/i18n/tr/command.d.ts.map +1 -1
- package/lib/i18n/tr/command.js +24 -0
- package/lib/i18n/tr/command.js.map +1 -1
- package/lib/i18n/tr/jig.d.ts +221 -0
- package/lib/i18n/tr/jig.d.ts.map +1 -1
- package/lib/i18n/tr/jig.js +21 -5
- package/lib/i18n/tr/jig.js.map +1 -1
- package/lib/i18n/zh/command.d.ts +34 -0
- package/lib/i18n/zh/command.d.ts.map +1 -1
- package/lib/i18n/zh/command.js +34 -0
- package/lib/i18n/zh/command.js.map +1 -1
- package/lib/i18n/zh/jig.d.ts +244 -0
- package/lib/i18n/zh/jig.d.ts.map +1 -1
- package/lib/i18n/zh/jig.js +135 -3
- package/lib/i18n/zh/jig.js.map +1 -1
- package/lib/view/AcTrView2d.d.ts +28 -0
- package/lib/view/AcTrView2d.d.ts.map +1 -1
- package/lib/view/AcTrView2d.js +147 -74
- package/lib/view/AcTrView2d.js.map +1 -1
- package/package.json +5 -5
- package/src/find/AcApFindNavigator.ts +190 -190
- package/src/find/findDrawing.ts +211 -211
- package/src/find/findText.ts +624 -624
- package/src/find/index.ts +2 -2
- package/src/ui/icons.ts +411 -411
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
+
extendStatics(d, b);
|
|
12
|
+
function __() { this.constructor = d; }
|
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
17
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
18
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
19
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
20
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
21
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
22
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
26
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
27
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
28
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
29
|
+
function step(op) {
|
|
30
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
31
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
32
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
33
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
34
|
+
switch (op[0]) {
|
|
35
|
+
case 0: case 1: t = op; break;
|
|
36
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
37
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
38
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
39
|
+
default:
|
|
40
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
41
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
42
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
43
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
44
|
+
if (t[2]) _.ops.pop();
|
|
45
|
+
_.trys.pop(); continue;
|
|
46
|
+
}
|
|
47
|
+
op = body.call(thisArg, _);
|
|
48
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
49
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
import { AcDb3PointAngularDimension, AcDbLine, AcGePoint3d } from '@mlightcad/data-model';
|
|
53
|
+
import { AcApDocManager } from '../../app';
|
|
54
|
+
import { AcEdCommand, AcEdOpenMode, AcEdPreviewJig, AcEdPromptEntityOptions, AcEdPromptPointOptions, AcEdPromptStatus } from '../../editor';
|
|
55
|
+
import { AcApI18n } from '../../i18n';
|
|
56
|
+
import { addCommonDimKeywords, applyCurrentDimStyle, commitDimBlock, DIM_PREVIEW_BLOCK, handleCommonDimKeyword, rebuildPreviewBlock, rememberCreatedDimension, removePreviewBlock } from './AcApDimCmdUtil';
|
|
57
|
+
var I18N = 'jig.dimangular';
|
|
58
|
+
var AcApDimAngularJig = /** @class */ (function (_super) {
|
|
59
|
+
__extends(AcApDimAngularJig, _super);
|
|
60
|
+
function AcApDimAngularJig(view, db, def) {
|
|
61
|
+
var _this = _super.call(this, view) || this;
|
|
62
|
+
_this._db = db;
|
|
63
|
+
_this._dim = new AcDb3PointAngularDimension(def.center, def.xLine1Point, def.xLine2Point, def.xLine1Point);
|
|
64
|
+
applyCurrentDimStyle(_this._dim, db);
|
|
65
|
+
return _this;
|
|
66
|
+
}
|
|
67
|
+
Object.defineProperty(AcApDimAngularJig.prototype, "entity", {
|
|
68
|
+
get: function () {
|
|
69
|
+
return this._dim;
|
|
70
|
+
},
|
|
71
|
+
enumerable: false,
|
|
72
|
+
configurable: true
|
|
73
|
+
});
|
|
74
|
+
AcApDimAngularJig.prototype.update = function (point) {
|
|
75
|
+
this._dim.arcPoint = new AcGePoint3d().copy(point);
|
|
76
|
+
rebuildPreviewBlock(this._db, this._dim, DIM_PREVIEW_BLOCK);
|
|
77
|
+
};
|
|
78
|
+
AcApDimAngularJig.prototype.end = function () {
|
|
79
|
+
_super.prototype.end.call(this);
|
|
80
|
+
removePreviewBlock(this._db, DIM_PREVIEW_BLOCK);
|
|
81
|
+
};
|
|
82
|
+
return AcApDimAngularJig;
|
|
83
|
+
}(AcEdPreviewJig));
|
|
84
|
+
export { AcApDimAngularJig };
|
|
85
|
+
/**
|
|
86
|
+
* DIMANGULAR — create a 3-point (or 2-line) angular dimension.
|
|
87
|
+
*/
|
|
88
|
+
var AcApDimAngularCmd = /** @class */ (function (_super) {
|
|
89
|
+
__extends(AcApDimAngularCmd, _super);
|
|
90
|
+
function AcApDimAngularCmd() {
|
|
91
|
+
var _this = _super.call(this) || this;
|
|
92
|
+
_this.mode = AcEdOpenMode.Write;
|
|
93
|
+
return _this;
|
|
94
|
+
}
|
|
95
|
+
AcApDimAngularCmd.prototype.execute = function (context) {
|
|
96
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
97
|
+
var editor, db, def, customText, textAngle, jig, prompt_1, result, arcPoint, dimension;
|
|
98
|
+
return __generator(this, function (_a) {
|
|
99
|
+
switch (_a.label) {
|
|
100
|
+
case 0:
|
|
101
|
+
editor = AcApDocManager.instance.editor;
|
|
102
|
+
db = context.doc.database;
|
|
103
|
+
return [4 /*yield*/, this.promptAngularDefinition()];
|
|
104
|
+
case 1:
|
|
105
|
+
def = _a.sent();
|
|
106
|
+
if (!def)
|
|
107
|
+
return [2 /*return*/];
|
|
108
|
+
customText = null;
|
|
109
|
+
jig = new AcApDimAngularJig(context.view, db, def);
|
|
110
|
+
_a.label = 2;
|
|
111
|
+
case 2:
|
|
112
|
+
prompt_1 = new AcEdPromptPointOptions(AcApI18n.t("".concat(I18N, ".arcPoint")));
|
|
113
|
+
addCommonDimKeywords(prompt_1, I18N);
|
|
114
|
+
prompt_1.jig = jig;
|
|
115
|
+
return [4 /*yield*/, editor.getPoint(prompt_1)];
|
|
116
|
+
case 3:
|
|
117
|
+
result = _a.sent();
|
|
118
|
+
if (result.status === AcEdPromptStatus.Cancel) {
|
|
119
|
+
jig.end();
|
|
120
|
+
return [2 /*return*/];
|
|
121
|
+
}
|
|
122
|
+
if (!(result.status === AcEdPromptStatus.Keyword)) return [3 /*break*/, 5];
|
|
123
|
+
return [4 /*yield*/, handleCommonDimKeyword(result.stringResult, jig.entity, I18N)];
|
|
124
|
+
case 4:
|
|
125
|
+
if (_a.sent()) {
|
|
126
|
+
customText = jig.entity.dimensionText;
|
|
127
|
+
textAngle = jig.entity.textRotation;
|
|
128
|
+
return [3 /*break*/, 6];
|
|
129
|
+
}
|
|
130
|
+
return [3 /*break*/, 6];
|
|
131
|
+
case 5:
|
|
132
|
+
if (result.status !== AcEdPromptStatus.OK || !result.value) {
|
|
133
|
+
jig.end();
|
|
134
|
+
return [2 /*return*/];
|
|
135
|
+
}
|
|
136
|
+
arcPoint = result.value;
|
|
137
|
+
jig.end();
|
|
138
|
+
dimension = new AcDb3PointAngularDimension(def.center, def.xLine1Point, def.xLine2Point, arcPoint);
|
|
139
|
+
applyCurrentDimStyle(dimension, db);
|
|
140
|
+
if (customText != null)
|
|
141
|
+
dimension.dimensionText = customText;
|
|
142
|
+
if (textAngle != null)
|
|
143
|
+
dimension.textRotation = textAngle;
|
|
144
|
+
commitDimBlock(db, dimension);
|
|
145
|
+
db.tables.blockTable.modelSpace.appendEntity(dimension);
|
|
146
|
+
rememberCreatedDimension(dimension.objectId);
|
|
147
|
+
return [2 /*return*/];
|
|
148
|
+
case 6: return [3 /*break*/, 2];
|
|
149
|
+
case 7: return [2 /*return*/];
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
};
|
|
154
|
+
AcApDimAngularCmd.prototype.promptAngularDefinition = function () {
|
|
155
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
156
|
+
var editor, firstPrompt, first, center, p1Prompt, p1, p2Prompt, p2;
|
|
157
|
+
return __generator(this, function (_a) {
|
|
158
|
+
switch (_a.label) {
|
|
159
|
+
case 0:
|
|
160
|
+
editor = AcApDocManager.instance.editor;
|
|
161
|
+
firstPrompt = new AcEdPromptPointOptions(AcApI18n.t("".concat(I18N, ".vertexOrSelect")));
|
|
162
|
+
firstPrompt.allowNone = true;
|
|
163
|
+
return [4 /*yield*/, editor.getPoint(firstPrompt)];
|
|
164
|
+
case 1:
|
|
165
|
+
first = _a.sent();
|
|
166
|
+
if (first.status === AcEdPromptStatus.Cancel)
|
|
167
|
+
return [2 /*return*/, null];
|
|
168
|
+
if (first.status === AcEdPromptStatus.None) {
|
|
169
|
+
return [2 /*return*/, this.promptTwoLines()];
|
|
170
|
+
}
|
|
171
|
+
if (first.status !== AcEdPromptStatus.OK || !first.value)
|
|
172
|
+
return [2 /*return*/, null];
|
|
173
|
+
center = first.value;
|
|
174
|
+
p1Prompt = new AcEdPromptPointOptions(AcApI18n.t("".concat(I18N, ".xLine1Point")));
|
|
175
|
+
p1Prompt.useBasePoint = true;
|
|
176
|
+
p1Prompt.useDashedLine = true;
|
|
177
|
+
p1Prompt.basePoint = new AcGePoint3d().copy(center);
|
|
178
|
+
return [4 /*yield*/, editor.getPoint(p1Prompt)];
|
|
179
|
+
case 2:
|
|
180
|
+
p1 = _a.sent();
|
|
181
|
+
if (p1.status !== AcEdPromptStatus.OK || !p1.value)
|
|
182
|
+
return [2 /*return*/, null];
|
|
183
|
+
p2Prompt = new AcEdPromptPointOptions(AcApI18n.t("".concat(I18N, ".xLine2Point")));
|
|
184
|
+
p2Prompt.useBasePoint = true;
|
|
185
|
+
p2Prompt.useDashedLine = true;
|
|
186
|
+
p2Prompt.basePoint = new AcGePoint3d().copy(center);
|
|
187
|
+
return [4 /*yield*/, editor.getPoint(p2Prompt)];
|
|
188
|
+
case 3:
|
|
189
|
+
p2 = _a.sent();
|
|
190
|
+
if (p2.status !== AcEdPromptStatus.OK || !p2.value)
|
|
191
|
+
return [2 /*return*/, null];
|
|
192
|
+
return [2 /*return*/, {
|
|
193
|
+
center: center,
|
|
194
|
+
xLine1Point: p1.value,
|
|
195
|
+
xLine2Point: p2.value
|
|
196
|
+
}];
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
});
|
|
200
|
+
};
|
|
201
|
+
AcApDimAngularCmd.prototype.promptTwoLines = function () {
|
|
202
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
203
|
+
var editor, db, line1Prompt, l1, line2Prompt, l2, e1, e2, hit;
|
|
204
|
+
return __generator(this, function (_a) {
|
|
205
|
+
switch (_a.label) {
|
|
206
|
+
case 0:
|
|
207
|
+
editor = AcApDocManager.instance.editor;
|
|
208
|
+
db = AcApDocManager.instance.curDocument.database;
|
|
209
|
+
line1Prompt = new AcEdPromptEntityOptions(AcApI18n.t("".concat(I18N, ".selectFirstLine")));
|
|
210
|
+
line1Prompt.addAllowedClass('Line');
|
|
211
|
+
line1Prompt.setRejectMessage(AcApI18n.t("".concat(I18N, ".rejectObject")));
|
|
212
|
+
return [4 /*yield*/, editor.getEntity(line1Prompt)];
|
|
213
|
+
case 1:
|
|
214
|
+
l1 = _a.sent();
|
|
215
|
+
if (l1.status !== AcEdPromptStatus.OK || !l1.objectId)
|
|
216
|
+
return [2 /*return*/, null];
|
|
217
|
+
line2Prompt = new AcEdPromptEntityOptions(AcApI18n.t("".concat(I18N, ".selectSecondLine")));
|
|
218
|
+
line2Prompt.addAllowedClass('Line');
|
|
219
|
+
line2Prompt.setRejectMessage(AcApI18n.t("".concat(I18N, ".rejectObject")));
|
|
220
|
+
return [4 /*yield*/, editor.getEntity(line2Prompt)];
|
|
221
|
+
case 2:
|
|
222
|
+
l2 = _a.sent();
|
|
223
|
+
if (l2.status !== AcEdPromptStatus.OK || !l2.objectId)
|
|
224
|
+
return [2 /*return*/, null];
|
|
225
|
+
e1 = db.tables.blockTable.getEntityById(l1.objectId);
|
|
226
|
+
e2 = db.tables.blockTable.getEntityById(l2.objectId);
|
|
227
|
+
if (!(e1 instanceof AcDbLine) || !(e2 instanceof AcDbLine))
|
|
228
|
+
return [2 /*return*/, null];
|
|
229
|
+
hit = intersectLines2d(e1.startPoint, e1.endPoint, e2.startPoint, e2.endPoint);
|
|
230
|
+
if (!hit) {
|
|
231
|
+
this.showMessage(AcApI18n.t("".concat(I18N, ".linesParallel")), 'warning');
|
|
232
|
+
return [2 /*return*/, null];
|
|
233
|
+
}
|
|
234
|
+
return [2 /*return*/, {
|
|
235
|
+
center: new AcGePoint3d(hit.x, hit.y, e1.startPoint.z),
|
|
236
|
+
// Prefer the endpoint farther from the intersection so the ray
|
|
237
|
+
// does not collapse when both lines were drawn toward the corner.
|
|
238
|
+
xLine1Point: fartherEndpoint(e1, hit),
|
|
239
|
+
xLine2Point: fartherEndpoint(e2, hit)
|
|
240
|
+
}];
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
});
|
|
244
|
+
};
|
|
245
|
+
return AcApDimAngularCmd;
|
|
246
|
+
}(AcEdCommand));
|
|
247
|
+
export { AcApDimAngularCmd };
|
|
248
|
+
function fartherEndpoint(line, hit) {
|
|
249
|
+
var d0 = Math.pow((line.startPoint.x - hit.x), 2) + Math.pow((line.startPoint.y - hit.y), 2);
|
|
250
|
+
var d1 = Math.pow((line.endPoint.x - hit.x), 2) + Math.pow((line.endPoint.y - hit.y), 2);
|
|
251
|
+
return d0 >= d1 ? line.startPoint.clone() : line.endPoint.clone();
|
|
252
|
+
}
|
|
253
|
+
function intersectLines2d(a0, a1, b0, b1) {
|
|
254
|
+
var dax = a1.x - a0.x;
|
|
255
|
+
var day = a1.y - a0.y;
|
|
256
|
+
var dbx = b1.x - b0.x;
|
|
257
|
+
var dby = b1.y - b0.y;
|
|
258
|
+
var denom = dax * dby - day * dbx;
|
|
259
|
+
if (Math.abs(denom) < 1e-12)
|
|
260
|
+
return null;
|
|
261
|
+
var t = ((b0.x - a0.x) * dby - (b0.y - a0.y) * dbx) / denom;
|
|
262
|
+
return { x: a0.x + t * dax, y: a0.y + t * day };
|
|
263
|
+
}
|
|
264
|
+
//# sourceMappingURL=AcApDimAngularCmd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+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E,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,KAAK,CAAA;IAC7D,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,GAAG,EAAE,CAAA;AACjD,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { AcDbArcDimension, AcDbDatabase, AcGePoint3dLike } from '@mlightcad/data-model';
|
|
2
|
+
import { AcApContext } from '../../app';
|
|
3
|
+
import { AcEdBaseView, AcEdCommand, AcEdPreviewJig } from '../../editor';
|
|
4
|
+
interface ArcDef {
|
|
5
|
+
center: AcGePoint3dLike;
|
|
6
|
+
xLine1Point: AcGePoint3dLike;
|
|
7
|
+
xLine2Point: AcGePoint3dLike;
|
|
8
|
+
}
|
|
9
|
+
export declare class AcApDimArcJig extends AcEdPreviewJig<AcGePoint3dLike> {
|
|
10
|
+
private _db;
|
|
11
|
+
private _dim;
|
|
12
|
+
constructor(view: AcEdBaseView, db: AcDbDatabase, def: ArcDef);
|
|
13
|
+
get entity(): AcDbArcDimension;
|
|
14
|
+
update(point: AcGePoint3dLike): void;
|
|
15
|
+
end(): void;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* DIMARC — arc-length dimension from a selected arc.
|
|
19
|
+
*/
|
|
20
|
+
export declare class AcApDimArcCmd extends AcEdCommand {
|
|
21
|
+
constructor();
|
|
22
|
+
execute(context: AcApContext): Promise<void>;
|
|
23
|
+
private promptArc;
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=AcApDimArcCmd.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApDimArcCmd.d.ts","sourceRoot":"","sources":["../../../src/command/draw/AcApDimArcCmd.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,gBAAgB,EAChB,YAAY,EAEZ,eAAe,EAChB,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EAAE,WAAW,EAAkB,MAAM,WAAW,CAAA;AACvD,OAAO,EACL,YAAY,EACZ,WAAW,EAEX,cAAc,EAIf,MAAM,cAAc,CAAA;AAerB,UAAU,MAAM;IACd,MAAM,EAAE,eAAe,CAAA;IACvB,WAAW,EAAE,eAAe,CAAA;IAC5B,WAAW,EAAE,eAAe,CAAA;CAC7B;AAED,qBAAa,aAAc,SAAQ,cAAc,CAAC,eAAe,CAAC;IAChE,OAAO,CAAC,GAAG,CAAc;IACzB,OAAO,CAAC,IAAI,CAAkB;gBAElB,IAAI,EAAE,YAAY,EAAE,EAAE,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM;IAY7D,IAAI,MAAM,IAAI,gBAAgB,CAE7B;IAED,MAAM,CAAC,KAAK,EAAE,eAAe;IAK7B,GAAG;CAIJ;AAED;;GAEG;AACH,qBAAa,aAAc,SAAQ,WAAW;;IAMtC,OAAO,CAAC,OAAO,EAAE,WAAW;YAkDpB,SAAS;CAgBxB"}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
+
extendStatics(d, b);
|
|
12
|
+
function __() { this.constructor = d; }
|
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
17
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
18
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
19
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
20
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
21
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
22
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
26
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
27
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
28
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
29
|
+
function step(op) {
|
|
30
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
31
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
32
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
33
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
34
|
+
switch (op[0]) {
|
|
35
|
+
case 0: case 1: t = op; break;
|
|
36
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
37
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
38
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
39
|
+
default:
|
|
40
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
41
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
42
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
43
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
44
|
+
if (t[2]) _.ops.pop();
|
|
45
|
+
_.trys.pop(); continue;
|
|
46
|
+
}
|
|
47
|
+
op = body.call(thisArg, _);
|
|
48
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
49
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
import { AcDbArc, AcDbArcDimension, AcGePoint3d } from '@mlightcad/data-model';
|
|
53
|
+
import { AcApDocManager } from '../../app';
|
|
54
|
+
import { AcEdCommand, AcEdOpenMode, AcEdPreviewJig, AcEdPromptEntityOptions, AcEdPromptPointOptions, AcEdPromptStatus } from '../../editor';
|
|
55
|
+
import { AcApI18n } from '../../i18n';
|
|
56
|
+
import { addCommonDimKeywords, applyCurrentDimStyle, commitDimBlock, DIM_PREVIEW_BLOCK, handleCommonDimKeyword, rebuildPreviewBlock, rememberCreatedDimension, removePreviewBlock } from './AcApDimCmdUtil';
|
|
57
|
+
var I18N = 'jig.dimarc';
|
|
58
|
+
var AcApDimArcJig = /** @class */ (function (_super) {
|
|
59
|
+
__extends(AcApDimArcJig, _super);
|
|
60
|
+
function AcApDimArcJig(view, db, def) {
|
|
61
|
+
var _this = _super.call(this, view) || this;
|
|
62
|
+
_this._db = db;
|
|
63
|
+
_this._dim = new AcDbArcDimension(def.center, def.xLine1Point, def.xLine2Point, def.xLine1Point);
|
|
64
|
+
applyCurrentDimStyle(_this._dim, db);
|
|
65
|
+
return _this;
|
|
66
|
+
}
|
|
67
|
+
Object.defineProperty(AcApDimArcJig.prototype, "entity", {
|
|
68
|
+
get: function () {
|
|
69
|
+
return this._dim;
|
|
70
|
+
},
|
|
71
|
+
enumerable: false,
|
|
72
|
+
configurable: true
|
|
73
|
+
});
|
|
74
|
+
AcApDimArcJig.prototype.update = function (point) {
|
|
75
|
+
this._dim.arcPoint = new AcGePoint3d().copy(point);
|
|
76
|
+
rebuildPreviewBlock(this._db, this._dim, DIM_PREVIEW_BLOCK);
|
|
77
|
+
};
|
|
78
|
+
AcApDimArcJig.prototype.end = function () {
|
|
79
|
+
_super.prototype.end.call(this);
|
|
80
|
+
removePreviewBlock(this._db, DIM_PREVIEW_BLOCK);
|
|
81
|
+
};
|
|
82
|
+
return AcApDimArcJig;
|
|
83
|
+
}(AcEdPreviewJig));
|
|
84
|
+
export { AcApDimArcJig };
|
|
85
|
+
/**
|
|
86
|
+
* DIMARC — arc-length dimension from a selected arc.
|
|
87
|
+
*/
|
|
88
|
+
var AcApDimArcCmd = /** @class */ (function (_super) {
|
|
89
|
+
__extends(AcApDimArcCmd, _super);
|
|
90
|
+
function AcApDimArcCmd() {
|
|
91
|
+
var _this = _super.call(this) || this;
|
|
92
|
+
_this.mode = AcEdOpenMode.Write;
|
|
93
|
+
return _this;
|
|
94
|
+
}
|
|
95
|
+
AcApDimArcCmd.prototype.execute = function (context) {
|
|
96
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
97
|
+
var editor, db, def, customText, textAngle, jig, prompt_1, result, dimension;
|
|
98
|
+
return __generator(this, function (_a) {
|
|
99
|
+
switch (_a.label) {
|
|
100
|
+
case 0:
|
|
101
|
+
editor = AcApDocManager.instance.editor;
|
|
102
|
+
db = context.doc.database;
|
|
103
|
+
return [4 /*yield*/, this.promptArc()];
|
|
104
|
+
case 1:
|
|
105
|
+
def = _a.sent();
|
|
106
|
+
if (!def)
|
|
107
|
+
return [2 /*return*/];
|
|
108
|
+
customText = null;
|
|
109
|
+
jig = new AcApDimArcJig(context.view, db, def);
|
|
110
|
+
_a.label = 2;
|
|
111
|
+
case 2:
|
|
112
|
+
prompt_1 = new AcEdPromptPointOptions(AcApI18n.t("".concat(I18N, ".arcPoint")));
|
|
113
|
+
addCommonDimKeywords(prompt_1, I18N);
|
|
114
|
+
prompt_1.jig = jig;
|
|
115
|
+
return [4 /*yield*/, editor.getPoint(prompt_1)];
|
|
116
|
+
case 3:
|
|
117
|
+
result = _a.sent();
|
|
118
|
+
if (result.status === AcEdPromptStatus.Cancel) {
|
|
119
|
+
jig.end();
|
|
120
|
+
return [2 /*return*/];
|
|
121
|
+
}
|
|
122
|
+
if (!(result.status === AcEdPromptStatus.Keyword)) return [3 /*break*/, 5];
|
|
123
|
+
return [4 /*yield*/, handleCommonDimKeyword(result.stringResult, jig.entity, I18N)];
|
|
124
|
+
case 4:
|
|
125
|
+
if (_a.sent()) {
|
|
126
|
+
customText = jig.entity.dimensionText;
|
|
127
|
+
textAngle = jig.entity.textRotation;
|
|
128
|
+
return [3 /*break*/, 6];
|
|
129
|
+
}
|
|
130
|
+
return [3 /*break*/, 6];
|
|
131
|
+
case 5:
|
|
132
|
+
if (result.status !== AcEdPromptStatus.OK || !result.value) {
|
|
133
|
+
jig.end();
|
|
134
|
+
return [2 /*return*/];
|
|
135
|
+
}
|
|
136
|
+
jig.end();
|
|
137
|
+
dimension = new AcDbArcDimension(def.center, def.xLine1Point, def.xLine2Point, result.value);
|
|
138
|
+
applyCurrentDimStyle(dimension, db);
|
|
139
|
+
if (customText != null)
|
|
140
|
+
dimension.dimensionText = customText;
|
|
141
|
+
if (textAngle != null)
|
|
142
|
+
dimension.textRotation = textAngle;
|
|
143
|
+
commitDimBlock(db, dimension);
|
|
144
|
+
db.tables.blockTable.modelSpace.appendEntity(dimension);
|
|
145
|
+
rememberCreatedDimension(dimension.objectId);
|
|
146
|
+
return [2 /*return*/];
|
|
147
|
+
case 6: return [3 /*break*/, 2];
|
|
148
|
+
case 7: return [2 /*return*/];
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
};
|
|
153
|
+
AcApDimArcCmd.prototype.promptArc = function () {
|
|
154
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
155
|
+
var editor, db, prompt, picked, entity;
|
|
156
|
+
return __generator(this, function (_a) {
|
|
157
|
+
switch (_a.label) {
|
|
158
|
+
case 0:
|
|
159
|
+
editor = AcApDocManager.instance.editor;
|
|
160
|
+
db = AcApDocManager.instance.curDocument.database;
|
|
161
|
+
prompt = new AcEdPromptEntityOptions(AcApI18n.t("".concat(I18N, ".selectArc")));
|
|
162
|
+
prompt.addAllowedClass('Arc');
|
|
163
|
+
prompt.setRejectMessage(AcApI18n.t("".concat(I18N, ".rejectObject")));
|
|
164
|
+
return [4 /*yield*/, editor.getEntity(prompt)];
|
|
165
|
+
case 1:
|
|
166
|
+
picked = _a.sent();
|
|
167
|
+
if (picked.status !== AcEdPromptStatus.OK || !picked.objectId)
|
|
168
|
+
return [2 /*return*/, null];
|
|
169
|
+
entity = db.tables.blockTable.getEntityById(picked.objectId);
|
|
170
|
+
if (!(entity instanceof AcDbArc))
|
|
171
|
+
return [2 /*return*/, null];
|
|
172
|
+
return [2 /*return*/, {
|
|
173
|
+
center: entity.center.clone(),
|
|
174
|
+
xLine1Point: entity.startPoint.clone(),
|
|
175
|
+
xLine2Point: entity.endPoint.clone()
|
|
176
|
+
}];
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
};
|
|
181
|
+
return AcApDimArcCmd;
|
|
182
|
+
}(AcEdCommand));
|
|
183
|
+
export { AcApDimArcCmd };
|
|
184
|
+
//# sourceMappingURL=AcApDimArcCmd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApDimArcCmd.js","sourceRoot":"","sources":["../../../src/command/draw/AcApDimArcCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EACL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B,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAG,IAAI,kBAAe,CAAC,CAAC,CAAA;wBAC5C,qBAAM,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,EAAA;;wBAAvC,MAAM,GAAG,SAA8B;wBAC7C,IAAI,MAAM,CAAC,MAAM,KAAK,gBAAgB,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ;4BAAE,sBAAO,IAAI,EAAA;wBACpE,MAAM,GAAG,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,aAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;wBAClE,IAAI,CAAC,CAAC,MAAM,YAAY,OAAO,CAAC;4BAAE,sBAAO,IAAI,EAAA;wBAC7C,sBAAO;gCACL,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE;gCAC7B,WAAW,EAAE,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE;gCACtC,WAAW,EAAE,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE;6BACrC,EAAA;;;;KACF;IACH,oBAAC;AAAD,CAAC,AAxED,CAAmC,WAAW,GAwE7C"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { AcDbAlignedDimension, AcDbDatabase, AcDbDimension, AcDbDimStyleTableRecord, AcDbRotatedDimension, AcGePoint3dLike } from '@mlightcad/data-model';
|
|
2
|
+
export declare const DIM_PREVIEW_BLOCK = "*UDIM";
|
|
3
|
+
export interface DimDefinitionPoints {
|
|
4
|
+
xLine1Point: AcGePoint3dLike;
|
|
5
|
+
xLine2Point: AcGePoint3dLike;
|
|
6
|
+
}
|
|
7
|
+
type DimWithBlock = AcDbDimension & {
|
|
8
|
+
createDimBlock(name: string): import('@mlightcad/data-model').AcDbBlockTableRecord;
|
|
9
|
+
};
|
|
10
|
+
/** Allocate the next anonymous dimension block name `*D{n}`. */
|
|
11
|
+
export declare function allocateDimBlockName(db: AcDbDatabase): string;
|
|
12
|
+
/** Ensure default arrow resources exist for dimension creation. */
|
|
13
|
+
export declare function ensureDimResources(db: AcDbDatabase): void;
|
|
14
|
+
/** Fields the Dimension Style Manager reads and writes. */
|
|
15
|
+
export declare const DIM_STYLE_FIELDS: readonly ["dimpost", "dimapost", "dimscale", "dimasz", "dimexo", "dimdli", "dimexe", "dimrnd", "dimdle", "dimtp", "dimtm", "dimtxt", "dimcen", "dimtsz", "dimaltf", "dimlfac", "dimtvp", "dimtfac", "dimgap", "dimaltrnd", "dimtfill", "dimtfillclr", "dimtxtdirection", "dimtol", "dimlim", "dimtih", "dimtoh", "dimse1", "dimse2", "dimtad", "dimzin", "dimazin", "dimalt", "dimaltd", "dimtofl", "dimsah", "dimtix", "dimsoxd", "dimclrd", "dimclre", "dimclrt", "dimadec", "dimdec", "dimtdec", "dimaltu", "dimalttd", "dimaunit", "dimfrac", "dimlunit", "dimdsep", "dimtmove", "dimjust", "dimsd1", "dimsd2", "dimtolj", "dimtzin", "dimaltz", "dimalttz", "dimatfit", "dimupt", "dimtxsty", "dimldrblk", "dimblk", "dimblk1", "dimblk2", "dimlwd", "dimlwe"];
|
|
16
|
+
export type DimStyleField = (typeof DIM_STYLE_FIELDS)[number];
|
|
17
|
+
export declare function readDimStyleFields(style: AcDbDimStyleTableRecord): Record<DimStyleField, unknown>;
|
|
18
|
+
export declare function writeDimStyleFields(style: AcDbDimStyleTableRecord, values: Partial<Record<DimStyleField, unknown>>): void;
|
|
19
|
+
export declare function getDimStyleOverride(db: AcDbDatabase): Partial<Record<"dimpost" | "dimapost" | "dimscale" | "dimasz" | "dimexo" | "dimdli" | "dimexe" | "dimrnd" | "dimdle" | "dimtp" | "dimtm" | "dimtxt" | "dimcen" | "dimtsz" | "dimaltf" | "dimlfac" | "dimtvp" | "dimtfac" | "dimgap" | "dimaltrnd" | "dimtfill" | "dimtfillclr" | "dimtxtdirection" | "dimtol" | "dimlim" | "dimtih" | "dimtoh" | "dimse1" | "dimse2" | "dimtad" | "dimzin" | "dimazin" | "dimalt" | "dimaltd" | "dimtofl" | "dimsah" | "dimtix" | "dimsoxd" | "dimclrd" | "dimclre" | "dimclrt" | "dimadec" | "dimdec" | "dimtdec" | "dimaltu" | "dimalttd" | "dimaunit" | "dimfrac" | "dimlunit" | "dimdsep" | "dimtmove" | "dimjust" | "dimsd1" | "dimsd2" | "dimtolj" | "dimtzin" | "dimaltz" | "dimalttz" | "dimatfit" | "dimupt" | "dimtxsty" | "dimldrblk" | "dimblk" | "dimblk1" | "dimblk2" | "dimlwd" | "dimlwe", unknown>> | null;
|
|
20
|
+
export declare function setDimStyleOverride(db: AcDbDatabase, values: Partial<Record<DimStyleField, unknown>> | null): void;
|
|
21
|
+
/** Bind the database current dimstyle ($DIMSTYLE) onto a new dimension. */
|
|
22
|
+
export declare function applyCurrentDimStyle(dim: AcDbDimension, db: AcDbDatabase): void;
|
|
23
|
+
/**
|
|
24
|
+
* Rebuild the temporary preview anonymous block for a dimension jig.
|
|
25
|
+
* Callers must remove `*UDIM` in jig.end().
|
|
26
|
+
*/
|
|
27
|
+
export declare function rebuildPreviewBlock(db: AcDbDatabase, dim: DimWithBlock, blockName?: string): void;
|
|
28
|
+
/** Commit a permanent `*D{n}` block and return the allocated name. */
|
|
29
|
+
export declare function commitDimBlock(db: AcDbDatabase, dim: DimWithBlock): string;
|
|
30
|
+
export declare function removePreviewBlock(db: AcDbDatabase, blockName?: string): void;
|
|
31
|
+
/**
|
|
32
|
+
* Extract two extension-line origins from a selected entity (AutoCAD object mode).
|
|
33
|
+
*/
|
|
34
|
+
export declare function definitionPointsFromEntity(entity: unknown): DimDefinitionPoints | null;
|
|
35
|
+
/** Infer horizontal (0) or vertical (π/2) from dim-line placement relative to the chord. */
|
|
36
|
+
export declare function inferLinearRotation(x1: AcGePoint3dLike, x2: AcGePoint3dLike, dimLinePoint: AcGePoint3dLike): number;
|
|
37
|
+
export declare function isRotatedDimension(dim: AcDbDimension): dim is AcDbRotatedDimension;
|
|
38
|
+
export declare function isAlignedDimension(dim: AcDbDimension): dim is AcDbAlignedDimension;
|
|
39
|
+
export {};
|
|
40
|
+
//# sourceMappingURL=AcApDimBlockUtil.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApDimBlockUtil.d.ts","sourceRoot":"","sources":["../../../src/command/draw/AcApDimBlockUtil.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EAGpB,YAAY,EAEZ,aAAa,EACb,uBAAuB,EAGvB,oBAAoB,EAEpB,eAAe,EAChB,MAAM,uBAAuB,CAAA;AAE9B,eAAO,MAAM,iBAAiB,UAAU,CAAA;AAExC,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,eAAe,CAAA;IAC5B,WAAW,EAAE,eAAe,CAAA;CAC7B;AAED,KAAK,YAAY,GAAG,aAAa,GAAG;IAClC,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,uBAAuB,EAAE,oBAAoB,CAAA;CACnF,CAAA;AAED,gEAAgE;AAChE,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,YAAY,GAAG,MAAM,CAY7D;AAED,mEAAmE;AACnE,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,YAAY,QAElD;AAED,2DAA2D;AAC3D,eAAO,MAAM,gBAAgB,quBAoEnB,CAAA;AAEV,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAA;AAK7D,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,uBAAuB,GAC7B,MAAM,CAAC,aAAa,EAAE,OAAO,CAAC,CAMhC;AAED,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,uBAAuB,EAC9B,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC,QAOhD;AAED,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,YAAY,+zBAEnD;AAED,wBAAgB,mBAAmB,CACjC,EAAE,EAAE,YAAY,EAChB,M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