Jump to content

Recommended Posts

Posted

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.

Posted

Can you post the code that does this: "put * PRELIMINARY ONLY * in a specific spot on each paper space" ?

Posted
(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)))
	
	);

Posted

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...icon11.gif

Posted

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.

Posted

Maybe even better to first make your insertionpoint : (setq ip (list 4.014 3.968) and then

 

This fixed it, thanks!

Posted

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.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...