您当前的位置: 首页 > 

插件开发

暂无认证

  • 3浏览

    0关注

    492博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

illustrator插件-常用功能模块-测量路径长度-js脚本开发-AI插件

插件开发 发布时间:2022-03-14 10:06:01 ,浏览量:3

文章目录
    • 1.算法程序
    • 2.作者答疑

1.算法程序

  illustrator是矢量编辑软件,画板是绘制处理的重要容器,在印刷方面的一个重要功能就是测量路径长度,开发一个测量路径长度功能,以下功能仅用于学习交流,请勿用于非法用途和商业用途,源代码如下所示:

var PMSLibs = confirm("此脚本会计算所选路径的长度及总长(毫米)\n\nAI脚本插件合集-插件定制,手机微信:18928899728");


var ver10  = (version.indexOf('10') == 0);
var verCS1 = (version.indexOf('11') == 0);
var verCS2 = (version.indexOf('12') == 0);

//var tim = new Date();
main();
//alert(new Date() - tim);

function main(){
  // Settings =================================

  // use "PathItem.length" property if CS3 or later
  var use_native_property = true;

  var font_size  = 12;
  var font_name  = "simsun";
  var digit    = 2;                   // number of digits after decimal point (round off last digit)
  var use_mm_4_unit = true;           // use millimeter as unit: true/false(use point)
  
  var put_text_on_the_first_layer = false;
  // true: put the texts on the first layer of the document. unlock and show it if it is locked or hidden.
  // false: put the texts on the active layer. if it is locked or hidden, put the text on the topmost
  //        layer of the selection.
  
  var div_num  = 1024;

  // ==========================================
  if(ver10 || verCS1 || verCS2){
    use_native_property = false;
  }
  
  if (documents.length            
关注
打赏
1665481431
查看更多评论
0.0449s