Jump to content

Recommended Posts

Posted

I have written a script that performs many actions. I have an if statement that runs to end the script uppon reatching the number of viewports in the layout tab, but what i'm after is just repeating the commands x number of times where x would be the number of viewports in the drawing. This would allow my routine to have no maximum number of viewports.

 

In the script I currently use the express tools extrim and burst. I downloaded a cookiecutter lisp that deletes everything outside my viewport border that is drawn by another lisp i have downloaded called vp-outline. If i don't have to select anything or pick points I can just run the lisps with a line like (c:vp-outline) but when running the express tools they I haven't been able to tell it what it wants inside the repeat. Any ideas?

Posted

Hmm, not sure what your question is...

Is this a script (.scr) or a lisp routine?

If you just wnat to know how to repeat a number equal to the number of Layouts, that would be:

 

(repeat (length (layoutlist))

 

If you need to supply responses to an Express Tools command, most likely you can't do that in a lisp but you could in a script. Will need more info.

Posted

I am working with a .scr file. I run this script on a batch of drawings through a program called script pro. This program allows you to run a script on a drawing set and will time out and move to the next drawing if there are errors to ensure the entire set is completed.

 

I have the repeat logic already done, but what I need answered is how to use an express tool like extrim or burst inside the repeat

 

(repeat (1- (length (vports)))

(c:vp-outline) ;;works great because needs no input

(c:extrim) ;; wants input after repeat runs??

(more stuff here)

)

 

I need to know how to tell extrim to use the vp-outline line that was drawn and how to tell it a point. The vp-outline generates a polyline of the current viewport, so it satisfies the "last" entry. Also I can put it into a group and extrim allows you to select a group.

Posted

I see, you are running a script but the call to Express Tools is from lisp code. I don't believe there is a way to supply arguments to the (c:extrim) function from a lisp. Many have tried.

 

Here's a thought, create a script to run extrim.

So in the lisp, instead of

(c:extrim)

 

use

(command "script" "trimit.scr")

 

and "trimit.scr" would consist of

 

EXTRIM
L
0,0

 

or instead of a hard coordinate, maybe a lisp variable named "VP_Cen" supplied in the script with

!VP_Cen

Posted

I have found a solution. I have created if statements inside the script that run certain sections if a counter indicates it han't been run yet, and if that counter hasn't reached the number of viewports in the drawing I run the script again via rscript.

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