jjatho Posted July 13, 2015 Posted July 13, 2015 I'm trying to write something quick that will put * PRELIMINARY ONLY * in a specific spot on each paper space I have in a drawing. I'm finding that the block inserted ends up basically everywhere except the coordinates I put in Lisp, and it's different for every page. I though maybe it had something to do with the current zoom level for each paper space. I have a separate small script PSCenter.lsp that I wrote which simply cycles through all paper spaces in a drawing and runs "zoom" "extent" on each to center them all up for me. I added the code from PSCenter.lsp to Prelim.lsp to center each page before inserting the block, but still have the same random, all over the place results. Quote
rkmcswain Posted July 13, 2015 Posted July 13, 2015 Can you post the code that does this: "put * PRELIMINARY ONLY * in a specific spot on each paper space" ? Quote
jjatho Posted July 13, 2015 Author Posted July 13, 2015 (cond ((="All" LabelType) (princ) (foreach tab (_layoutlist) (setvar 'ctab tab) (command "Zoom" "extents") (command "_.INSERT" "Preliminary" "S" "1" "R" "0" 4.014386432 3.96875 "") ) (setvar 'ctab (car (_layoutlist))) ); Quote
rlx Posted July 13, 2015 Posted July 13, 2015 Maybe you can write something like: (setq ss (ssget "X" (list (cons 0 "INSERT")(cons 2 #yourblockname#) (cons 410 (getvar "CTAB")))) if your block has a fixed size than you can get its insertion point and than calculate the offset for your string position gr. Rlx oop , thought you wanted to insert it relative to a block already there... Quote
rlx Posted July 13, 2015 Posted July 13, 2015 Youre insertion point , should it no be "4.014386432,3.96875"? Maybe even better to first make your insertionpoint : (setq ip (list 4.014 3.968) and then (setvar "attreq" 0);if needed (command "-INSERT" "Preliminary" ip 1 1 0) Gr. R. Quote
jjatho Posted July 13, 2015 Author Posted July 13, 2015 Maybe even better to first make your insertionpoint : (setq ip (list 4.014 3.968) and then This fixed it, thanks! Quote
BIGAL Posted July 14, 2015 Posted July 14, 2015 You may want to add a "PSPACE" else the block may end up in model space if you open a tab and the viewport is set to modelspace. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.