- 精华
- 活跃值
-
- 积分
- 1704
- 违规
-
- 印币
-
- 鲜花值
-
- 在线时间
- 小时
累计签到:223 天 连续签到:1 天
|
发表于 2023-8-20 12:14:55
|
显示全部楼层
Sub 编号()
ActiveDocument.BeginCommandGroup "编号"
Dim s As Shape
Dim i As Integer
i = 1
' 遍历选中的形状
For Each s In ActiveSelectionRange
' 获取形状的中心坐标
Dim centerX As Double
Dim centerY As Double
centerX = s.centerX
centerY = s.centerY
' 创建艺术字形状,并设置文本内容为数字
Dim textShape As Shape
Set textShape = ActiveLayer.CreateArtisticText(centerX, centerY, i)
If textShape.SizeWidth > s.SizeWidth * 0.85 Then
textShape.SizeWidth = s.SizeWidth * 0.85
End If
textShape.centerX = s.centerX
textShape.centerY = s.centerY
i = i + 1
Next s
ActiveDocument.EndCommandGroup
End Sub
大神,这个代码是论坛jiangyu写的,可以用于x4自动编码脚本,看看能不能改成你插件那样子 |
|