在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 14034|回复: 30

[求助] 关于十字标尺的cadence skill,诸多不会,请教大侠们~~~~~

[复制链接]
发表于 2013-1-31 15:27:10 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
在看cadence skill的东西,有点晕头转向了~~~决定先看几个程序找找感觉。
          下文是在网上找的一个十字标的skill,按照自己的理解做了一些备注,很多地方没有弄懂,如果有错的地方大家,请帮纠正啊~~~~~
=========================================================================

procedure( CreateCrossRuler()  leHiClearRuler()  CrossRuler()  )

procedure(CrossRuler()

vr = 200  //定义参数vr=200,应该是未确定十字标的测量长度的。


p0 = enterPoint()  //enterPoint这个函数没有找到他的mode,看起来是读取一个坐标点给p0(),结合使用时的感觉应该是在选择十字标尺后,需要点击下某个位置时响应的函数,应该是在那时读取了哪一点的坐标)


p1 = geWindowToEditPoint(hiGetCurrentWindow(),p0)

//看起来这句的作用是也是在当前窗口中读取坐标,没看懂(提供的p0为什么不能直接用),很不理解~~~~~hiGetCurrentWindow()表示其选取坐标的窗口,p0是之前输入的坐标

//函数的mode:

//geWindowToEditPoint
//Description


//Translates coordinate values when you are using edit in place. geWindowToEditPoint
//applies the top-level cellview’s coordinates to the cellview being edited;
//当你在某一个地方使用该函数编辑时它会传递一个坐标值,geWindowToEditPoint函数提供顶层cellview的坐标用于编辑计   


//算。(没搞懂什么意思~~~~~~~~)

px = xCoord(p1), py = yCoord(p1)

//你点击的点的x坐标值,y坐标值分别赋值给px,py

dx = px+vr, dy = py+vr

sx = px-vr, sy = py-vr

//以你点击的点位中心原点,计算上下左右方向的x、y的数值

leCreateRuler(geGetEditRep() list(px:pypx:dy))

leCreateRuler(geGetEditRep() list(px:pydx:py))

leCreateRuler(geGetEditRep() list(px:pysx:py))

leCreateRuler(geGetEditRep() list(px:pypx:sy))

//以你点击的原点向上下左右生成标尺。

//An alias for geGetEditCellView. Returns the ID for the cellview being edited.

//geGetEditCellView 看描述是可以返回当前被编译的cellview的ID的。试了一下,会返回:db:123123

//之类的东西。个人理解是为了位lecreateruler 函数提供操作进行的窗口的参数提醒。

)











=========================================================================
 楼主| 发表于 2013-1-31 16:09:10 | 显示全部楼层
回复 1# 3512596
好了 ,刚请教下朋友,终于整明白了,上边写的很乱,重新写一下正确的理解吧,哎~ ~!~~~~
 楼主| 发表于 2013-1-31 16:18:39 | 显示全部楼层
回复 2# 3512596


   

procedure(CreateCrossRuler()//函数名

leHiClearRuler()//清除,可以拿掉,只不过每次用的时候,上次用的不会消失了而已。

CrossRuler()//执行crossruler函数体

)

procedure(CrossRuler()//函数体声明

vr = 200   //定义参数vr 其实可以不用的,后边直接用数字就好了。


p0 = enterPoint()//通过函数enterpoint()加上你鼠标点击的那下获取一个坐标


p1 = geWindowToEditPoint(hiGetCurrentWindow(),p0)//higetcurrentwindow是为了确定当前窗口的函数,然后通过函数gewindowtoeditpoint 将窗口信息和坐标p0 传递给p1。这里的p0和p1可不是同等意义的东西了。

px = xCoord(p1), py = yCoord(p1)//将p1的x、y坐标分别赋值给px、py

dx = px+vr, dy = py+vr

sx = px-vr, sy = py-vr

leCreateRuler(geGetEditRep() list(px:pypx:dy))//四条尺标就是十字尺了

leCreateRuler(geGetEditRep() list(px:pydx:py))//gegeteditrep()是为了获取当前窗口的id的,这句也可以用上边的

                                                                        // hiGetCurrentWindow(),都是为了指定要进行造作的窗口。

leCreateRuler(geGetEditRep() list(px:pysx:py))

leCreateRuler(geGetEditRep() list(px:pypx:sy))

)

真没有大侠理我这菜鸟啊啊~~~~~~~~~~~~~

发表于 2013-2-4 09:18:46 | 显示全部楼层
去查手册吧。好像装了icfb就可以找到。非常多!
或者去版图模块碰碰运气。
发表于 2013-2-17 13:37:13 | 显示全部楼层
procedure( CreateCrossRuler()
" Create Cross Ruler"
leClearAllRuler(getEditRep())
location1=enterPoint(?prompts list("Please digitize or type absolute location"))
location=geWindowToEditPoint(hiGetCurrentWindow(),location1)
leCreateRuler( getEditRep() list(location xCoord(location)+5000:yCoord(location) xCoord(location)+5000:yCoord(location)))
leCreateRuler( getEditRep() list(location xCoord(location)-5000:yCoord(location) xCoord(location)-5000:yCoord(location)))
leCreateRuler( getEditRep() list(location xCoord(location):yCoord(location)+5000 xCoord(location):yCoord(location)+5000))
leCreateRuler( getEditRep() list(location xCoord(location):yCoord(location)-5000 xCoord(location):yCoord(location)-5000))
); procedure
发表于 2013-4-7 08:59:33 | 显示全部楼层
学习中
发表于 2013-4-26 10:12:49 | 显示全部楼层
学习了!!!
发表于 2013-4-26 11:20:50 | 显示全部楼层
我试了下,5000应该是十字标尺的量度,如果有需要,可以改成自己用着方便的数字,比如,500、1000之类的。
发表于 2013-4-30 20:15:19 | 显示全部楼层
回复 5# yuama


    这个可是我写的啊,原始的是8个方向,也就是一个“米”字效果的尺子的。
 楼主| 发表于 2013-6-17 10:12:52 | 显示全部楼层
回复 9# xuhongwei_li
盗用 遇到正主了
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /3 下一条

×

小黑屋| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-4-25 05:17 , Processed in 0.044545 second(s), 8 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表