I have searching many method to undo ruler by using skill but failed.
Its there any method /skill code that manage to draw and undo the ruler one by one.
All there currently is is leClearAllRuler(). You can't do them one by one.
There are however enhancements coming with rulers in IC614. I think a side effect of that will allow you to create and then delete rulers individually.
In reply to Andrew Beckett:
Thanks for the reply.
That means we can't undo/delete the ruler individually, so sad to know that. :(
Hopefully i can get IC614 soon.
In reply to kbhow:
You can get creative and make your own ruler function that stores off your ruler points in a global variable. Then you can undo the rulers by clearing them all and recreating all rulers except the last one.
procedure(myRuler(@optional (cv geGetEditCellView())) unless(boundp('rulerHistory) rulerHistory = makeTable("rulerHistory" nil) ) pts = enterLine(?prompts list("Point to first point of the ruler" "Point at the next point of the ruler") ?wantPoints 2) leCreateRuler(geGetEditCellView() pts) rulerHistory[cv] = cons(pts rulerHistory[cv])) ;proc
procedure(clearMyLastRuler(@optional (clearAll nil) (cv geGetEditCellView()) ) leHiClearRuler() if(clearAll then rulerHistory[cv] = nil else rulerHistory[cv] = cdr(rulerHistory[cv]) foreach(pts rulerHistory[cv] leCreateRuler(cv pts) ) )) ;proc
In reply to dmay:
Thank you for sharing your code Derek!
While we are on the topic of Rulers, I recently also wrote a somewhat similar solution for getting the length of each ruler printed to the CIW for added help/readability. Here's the link to the Online Support Solution:
SourceLink Solution 11553680
In reply to skillUser:
Your script works well :D. Just i need to make it interactive so that user not need to recall the function for ruler and able to use reursively until the ESC button is hit.
Thanks a lot for the sharing =D
You should be able to use the solution I wrote to help you to make Derek's code more interactive (e.g. create a bindkey for it, use an Options form to control the function behaviour).
Let me (well, everyone) know if you need more help.
Cool. I got it, i got it. I combine both script into one and its able to works interactively and able to undo the ruler as well. =D
This is what i'm looking for for quite a long time. Thanks man. Cheers
By storing the ruler's pts into a global table will enable user to do undo ruler individually. What if user use hiClearAllRuler() function to clear all rulers, the data that store in the table will not change rite?
So, when user undo the ruler, there will prompts many other rulers which is initially store in the table. Any workaround for this?
For your script, is it I need to instantiate the form at least ONCE before I use the function to create ruler?
The function seem like not working, but after i hit F3 button to call the form and hide it, it will only able to peform well. Please advice.
Notice in the clearMyLastRuler command, I had put in an optional "clearAll" argument. If set to t, not only does it clear all rulers in the window, but it also resets the global variable. Your users should use this command to clear all the rulers.
procedure(clearMyLastRuler(@optional (clearAll nil) (cv geGetEditCellView()) ) leHiClearRuler() if(clearAll then rulerHistory[cv] = nil
im able to draw the ruler and clear the last ruler base on the script from dmay. user can draw the ruler and clear the ruler by a bindkey, without calling the function again. the problem is, because of the enter function, it would not be able to show the length of ruler during drawing. it only shows the length when user has finished entering points.
any idea on how to show the length while drawing by enter function?
In reply to ccKev:
I don't know of a way to do this. The only dynamic ruler I know of is leHiCreateRuler. This is an enterFunction provided by Cadence that doesn't allow you to undo previous rulers. Thus I provided the above enterFunction to overcome the undo limitation but this loses the dynamic ruler capability. I don't know of any way to get two enterFunctions to run at the same time. So you can either run one or the other, but not both.
This request falls into the Cadence R&D court as an enhancement.
Hi Derek, Kevin and How,
In the soon-to-be-arriving IC614 release there are many enhancements to the ruler capabilities, such as the ability to draw and then remove specific rulers. Since this is an in-built capability, it will behave similarly to the existing ruler in the way that you can see the ruler and tick marks and sizes while it is being drawn (which you don't see if you are using the enterLine enter function). The ruler function will also have built in "smarts" so that itcan guess if you are measuring from edge to edge, corner to corner etc. based on ruler direction and initial points. It will use, I believe, the gravity aperture as the search window for the point and can be made to "snap" to point types (e.g. center, edge, vertex).
Hopefully the new capabilities will address many, if not all, of the concerns that layout designers have about rulers.
You can easily setup ruler snapping in 5.1.41. We have done with the code below. The bindkeys I defined allow you to start and stop the ruler with the middle mouse button and it will snap to edges within the aperture defined on the Layout Editor Options form.
procedure(mySnappingRuler() let((gravity infix depth type bouncex bouncey rptVar) if(hiGetCurrentCmd(hiGetCurrentWindow()) == "Ruler" then mouseAddPt() else infix = hiGetCIWindow()->infix gravity = envGetVal("layout" "gravityOn") depth = envGetVal("layout" "gravityDepth") type = envGetVal("layout" "gravityType") bouncex = envGetVal("layout" "gravityBounceX") bouncey = envGetVal("layout" "gravityBounceY") envSetVal("layout" "gravityOn" 'boolean t) envSetVal("layout" "gravityDepth" 'int 20) envSetVal("layout" "gravityType" 'string "edge") envSetVal("layout" "gravityBounceX" 'float 0) envSetVal("layout" "gravityBounceY" 'float 0) hiGetCIWindow()->infix = t rptVar=envGetVal("layout" "modalCommands") envSetVal("layout" "modalCommands" 'boolean nil) leHiCreateRuler() envSetVal("layout" "modalCommands" 'boolean rptVar) envSetVal("layout" "gravityOn" 'boolean gravity) envSetVal("layout" "gravityDepth" 'int depth) envSetVal("layout" "gravityType" 'string type) envSetVal("layout" "gravityBounceX" 'float bouncex) envSetVal("layout" "gravityBounceY" 'float bouncey) hiGetCIWindow()->infix = infix ) ) ;let) ;proc
hiSetBindKey("Layout" "<Btn2Down>" "mySnappingRuler()")hiSetBindKey("Layout" "<Btn2Down> EF" "mySnappingRuler()")You can define the aperture per user using:envSetVal("layout" "gravityAperture" 'float 0.5)