Jump to content

Save as liner number


SunnyTurtle

Recommended Posts

Hi

I am creating many new drawing which are exactly the same except they have a differing Xref.

i want to create a drawing saved as 501.dwg to 703.dwg

And I have xrefs that are called page x_page 1.dwg to x_page 202.dwg

i have already created 501.dwg it has 1 block and 1 xref already in it.

I want all dwgs to have this block and xref but have a another differing xref

I’ve done stuff like this manually many times and I always thought there must be a way to automate it I have often made Scrips to help me out. But the saveas function is a part that need to vary I think lisp can do this but i an unsure where to even start.

Link to comment
Share on other sites

saves should work in a script where you come undone is when it has spaces in the directory name or dwg name you could make it a variable in your script (setq newdnwgo "C:/dir1/job/his/dwgnamex")

 

saves !newdwgno

Link to comment
Share on other sites

Sound like a good idea. Even if i don't get the exact file names that i need i can run lupas rename over it to get the exact filename

 

This is what iv got it still need a loop and all the commands from the script.

also im still looking into a removing " lisp.

 

(defun a ()
(setq ofl "L:/30011010/CAD/DWG/03_RD_Roads/300011013-DRD-050")
(setq cout 1)
(setq cout (+ cout 1))
(setq nfn (list ofl cout))
 need something here to remove "
 (command "saveas" nfn)
 ) ;then repeat

Link to comment
Share on other sites

(setq ofl "L:/30011010/CAD/DWG/03_RD_Roads/300011013-DRD-050")

 

Question for you:

 

This pattern:

drawing 501.dwg with xref page x_page 1.dwg ?

drawing 502.dwg with xref page x_page 2.dwg ?

 

Are the xref files (page x_page 1.dwg to x_page 202.dwg) existing?

 

I would suggest using Wblock instead

You can change the Xref Path before you wblock the entire drawing with a new name specified

 

before invoking Wblock

 (vla-put-path CurXref  [i]PathofNextXref[/i])

PathofNextXref= (strcat XrefPath "page x_page" (itoa cnt) ".dwg ")

 

then

 (vl-cmdf "-wblock" NewName "*")

 

(setq ofl "L:\\30011010\\CAD\\DWG\\03_RD_Roads\\300011013-DRD-050\\")

 

NewNAme=(strcat ofl "Drawing_50" (itoa cnt))

 

in theory it shoudl work :)

Link to comment
Share on other sites

Question for you:

 

This pattern:

drawing 501.dwg with xref page x_page 1.dwg ?

drawing 502.dwg with xref page x_page 2.dwg ?

 

Are the xref files (page x_page 1.dwg to x_page 202.dwg) existing?

To answer your question the xrefs already exist.

I am not sure about Xblock because I the xref need to be listed in the title block and someone else does that part.

 

But thanks for your advise i will look into over the weekend Maybe or ill just play xbox ha ha

Link to comment
Share on other sites

To answer your question the xrefs already exist.

 

Now that makes it easier

 

Wblock (not Xblock btw) with "*" will make an exact copy of your drawing (including viewports and layouts and XREFS)

 

Modfying the titleblock is to include the attached xref would be easy. (especially if you're using fields)

 

Anyhoo...

 

Maybe or ill just play xbox ha ha

 

me too... :)

Link to comment
Share on other sites

Hi pBe thanks for all the help i have now done this manualy and no longer have access to play around with the files seeing as i have move office.

 

Is there any tutorals on how to use Wblock becasue i would like you learn more.

 

Also are you able to overlay wblocks as xrefs.

Link to comment
Share on other sites

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