Is there any way to either add coordinates to or pass coordinates to leHiCreateIns() without clicking in the interface?
I would like to place instances generally at the origin, but often at other known coordinates, and would like to do so without first zooming in close enough to get an exact snapped coordinate, or alternatively by clicking at a random location to place, and then having to select the instance, get its properties, and finally specify the correct coordinate location.
Any insight into streamlining this or if there is a script to do it would be much appreciated.
Yes, you can use preXY() to specify a point before a command (such as leHiCreateInst()) to enter the point in a queue. This should do what you are asking I think.
In reply to skillUser:
And, if you are asking about this interactively (rather than 'scripted') then you can just enter the coordinates in the CIW, e.g. 0:0 or "list(0 0)". So, in short, if you are running a command interactively then you can typically supply one or more pairs of coordinates in the CIW, but if you are trying to use a scripted flow (such as in a regression suite) then you might use preXY() before a command.
Thank you Lawrence,
Can you offer any code to successfully execute the preXY() cmd before a command such as leHiCreateInst() in a script?
If I type these commands in the CIW successively, preXY() accepts my supplied coordinates, but they seem to be disregarded by the leHiCreateInst() command following....leHiCreateInst() seems intent on waiting for a user click - although I can successfully (re)type the coordinates into the CIW for Create Instance to accept. (That in itself is very helpful though.)
Ideally I would love to have the X and Y coords added to the Create Inst form, or any similar form. I could create a form that has coordinate fields but do not know how to pass these to the Create Instance command if it does not seem to accept them via CIW....
In reply to jaleco:
In reply to Andrew Beckett:
Thanks Andrew and Lawrence for your suggestions.
Typing coords in the CIW is good for one-time instance placement at random spec'd coordinates.
However, I realized that the majority of the time I am creating a new layout view, I place an instance at the origin, and typing (0:0) in the CIW got old, so I found a solution to automate it by assigning a bindkey to the addPoint() function. Here is some sample code:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Create new instance procedure to redefine the "o" key; so an instance can be placed at the origin procedure( SNLhiCreateInstO() hiSetBindKey("Layout" "<Key>o" "addPoint((0:0))") leHiCreateInst() hiSetBindKey("Layout" "<Key>o" "leHiCreateContact()")); procedure
hiSetBindKey("Layout" "<Key>i" "SNLhiCreateInstO()")
I have re-defined the "i" bindkey to call a custom hiCreateInst() function, which re-assigns the "o" key to add a point at the origin. Once the CreateInst form is closed, the "o" key is re-assigned to its standard function of leHiCreateContact(). Between the option of typing a coordinate list to the CIW and having a bindkey for the most-often used coordinates, this is working pretty well for me.
BTW, Andrew, I did look into using dbCreateInst, but it lacks the array and spacing functionality (parameters) of the leHiCreateInst form, so not as powerful an option. For example I could create an instance at specified coordinates using dbCreateInst, but could not create an array instance of a unit cell unless I use the leHiCreateInst form.
You could use dbCreateSimpleMosaic if you want to create an array rather than a single instance.