Jump to content

To save with specific portion from 1000 same dwgs which same as mentioned dwg No.


isutheparambil

Recommended Posts

Hi,

 

I am trying for a way to save from multiple same drawings with different file names (1000 files I have) with only containing a specific portion only from the whole drawing that portion need to include the named portion as the drawing number.

There is no blocks or any attributes in this drawing.

 

For example please see the attached

 

the same drawing i need to save the plot named 630 that same as the drawing number.

 

if the drawing number is 631, then i need to erase all other plots except 631.

Now i am doing that erasing the unwanted plots from each drawing and saving each drawing individually.

 

I hope you getting my requirement.

 

Anybody have an idea to solve this issue, Please share with me..

 

 

Thanks in advance...:):):):)

sample.jpg

630.dwg

Link to comment
Share on other sites

  • Replies 24
  • Created
  • Last Reply

Top Posters In This Topic

  • isutheparambil

    11

  • BIGAL

    5

  • maratovich

    5

  • devitg

    2

Top Posters In This Topic

Posted Images

This can be done (but very long) if:

- all files are like an example

- a polyline on a separate layer, without other elements on this layer

- number on a separate layer, without other elements on this layer

- etc.

You need to see the full file.

Link to comment
Share on other sites

You could find the text insertion point then use (command "bpoly" pt "") to make a new pline of the plot, get the co-ordinates, then write a script file that has all the plots with New at start and a saveas plot number last. Do the corner points needs to go also ? Is the output to be saved in a dwg template ? Or else use open rather than new, it needs a zoom factor but again thats easy using extmin & extmax. Obviosuly stuff like layers etc

 

new
pline
x,y x,y x,y x,y c
text plotmum....
saveas
plotnum
close
new
pline
x,y x,y x,y x,y c
text plotnum ......
saveas
plotnum
saveas
close

 

Maybe a lisp - scripted

(do_lots 621 pt1 pt2 pt3 pt4)
(do_lots 622 pt1 pt2 pt3 pt4)

Edited by BIGAL
Link to comment
Share on other sites

Try this it is set up as a test and needs a little bit of user mod, I have set the repeat function at 3 for testing and it created 3 new dwg's. It is set up looking for a c:\temp directory for testing so writes the new ones there. I saved a blank version of your dwg called PLOTS to the c:\temp as I open this up and put the new plot in this dwg this way layers or any other stuff is still there.

 

One important thing is it does not check for existing dwg so will error if it already exists. It needs to know the location of the outputs etc but that can be added.

 

Try and let me know.

 

does 3 plots

; pline co-ords example
; By Alan H
(defun getcoords (ent)
(vlax-safearray->list
(vlax-variant-value
(vlax-get-property
(vlax-ename->vla-object ent)
"Coordinates"
)
)
)
)

; program starts here
; writes out a bpoly of a plot and the label for that plot
; to a brand new file of just that plot
(defun do_lots ( / ss x y fn)
(setq oldsnap (getvar 'osmode))
(setvar 'osmode 0)
(setq ss (ssget "X" (list (cons 0 "*text")(cons 8 "Villa Numbers"))))
(setq fn (open "C:\\temp\\plots.scr" "W"))
(setq x 0) ; rem this out for all plots
(repeat 3  ; for testing
;(repeat (sslength ss) for all
(setq txt (vlax-ename->vla-object (ssname ss x)))
(setq txtstr (vla-get-textstring txt))
(setq txtins (vlax-safearray->list (vlax-variant-value (vla-get-insertionpoint txt))))
(command "bpoly" txtins "")
(setq co-ords (getcoords (entlast)))
(command "erase" "l" "")
(write-line "open C:/Temp/Plots.dwg" fn)
(write-line "clayer" fn)
(write-line (strcat "\"" "Villa Plot Limits" "\"") fn)
(write-line "Pline" fn)
(setq y 0)
(repeat (/ (length co-ords) 2)
(write-line (strcat (rtos  (nth y co-ords) 2 3 ) "," (rtos (nth (+ y 1) co-ords) 2 3)) fn)
(setq y (+ y 2))
)
(write-line "c" fn)
(write-line "zoom extents" fn)
(write-line "Text" fn)
(write-line (strcat (rtos (nth 0 txtins) 2 3) "," (rtos (nth 1 txtins) 2 3 )) fn)
(write-line  "2.0" fn)
(write-line "0" fn)
(write-line txtstr fn)
(write-line "filedia" fn)
(write-line "0" fn)
(write-line "saveas" fn)
(write-line "2013" fn)
(write-line (strcat "C:/temp/" txtstr) fn)
(write-line "close" fn)
(setq x (+ x 1))
)
(close fn)
(setvar 'osmode oldsnap)
)
(do_lots)
(command "script" "c:\\temp\\plots")

Edited by BIGAL
Link to comment
Share on other sites

This can be done (but very long) if:

- all files are like an example

- a polyline on a separate layer, without other elements on this layer

- number on a separate layer, without other elements on this layer

- etc.

You need to see the full file.

 

Yes..

 

This will take a long procedure to create a short cut.

BIGAL's instruction also good one, but this time not enough time to sped on it.

So for this case I am on the way to finish 1000 drawings, Already completed 1/3 by half a day.

 

Bad luck for this time...

we will find a solution for this case later for future...8)8)8)

 

Thank you guys for your great supports and valuable instructions..:):):)

Link to comment
Share on other sites

Hi BIGAL,

 

Give me little bit time to test your program, Of course I will let you know the feedback ASAP.

 

Once more.... Thanks a lot BIGAL...:):):)

Link to comment
Share on other sites

Important make the master dwg not named a lot number as it stops the production of the other dwgs. I fixed a couple of little things like osnap problems seems to work for me created 20 dwgs before lot conflict happened.

 

Just copy and paste the code to notepad save it as say dolots.lsp file.

 

As I said before its set up for a directory called c:\temp make it ! copy your 630lots.dwg to there erase all the lots and save as PLOTS.dwg in c:\temp

 

Then open 630lots and type (load "dolots") it should just go away and make 3 dwgs as a test.

Link to comment
Share on other sites

Some like it.

 

I'm on line

 

devitg@gmail.com

 

Yes DEVITG,

 

This way I need, but with the plot points and corner numbers...

 

Sorry for the late reply for all,

 

I was rush with some urgent works that I needs to finish.

 

As the attached files I need the drawings.

I mean single plots as you sent that with the exact coordinates for each own plots.

 

If you found a way that, please let me know.

 

Thanks again for all you guys supports.

Edited by isutheparambil
Link to comment
Share on other sites

Important make the master dwg not named a lot number as it stops the production of the other dwgs. I fixed a couple of little things like osnap problems seems to work for me created 20 dwgs before lot conflict happened.

 

Just copy and paste the code to notepad save it as say dolots.lsp file.

 

As I said before its set up for a directory called c:\temp make it ! copy your 630lots.dwg to there erase all the lots and save as PLOTS.dwg in c:\temp

 

Then open 630lots and type (load "dolots") it should just go away and make 3 dwgs as a test.

 

Hi BIGAL,

 

Sorry for the late reply as I was little busy with some urgent work.

 

Let me try as you post, and sure I will get back to you soon...

 

Thanks BIGAL....

Link to comment
Share on other sites

Important make the master dwg not named a lot number as it stops the production of the other dwgs. I fixed a couple of little things like osnap problems seems to work for me created 20 dwgs before lot conflict happened.

 

Just copy and paste the code to notepad save it as say dolots.lsp file.

 

As I said before its set up for a directory called c:\temp make it ! copy your 630lots.dwg to there erase all the lots and save as PLOTS.dwg in c:\temp

 

Then open 630lots and type (load "dolots") it should just go away and make 3 dwgs as a test.

 

Hi BIGAL,

 

That not working for me.

 

Anyway, one more thing need to be note, that each corner have a point and number.

I need each plots with - plot line, corner point and corner number.

 

That is the real requirement...8)8)8)

Link to comment
Share on other sites

Important make the master dwg not named a lot number as it stops the production of the other dwgs. I fixed a couple of little things like osnap problems seems to work for me created 20 dwgs before lot conflict happened.

 

Just copy and paste the code to notepad save it as say dolots.lsp file.

 

As I said before its set up for a directory called c:\temp make it ! copy your 630lots.dwg to there erase all the lots and save as PLOTS.dwg in c:\temp

 

Then open 630lots and type (load "dolots") it should just go away and make 3 dwgs as a test.

 

Hi,

 

Just clarify me how can run the lisp..

as you mention, I tried to load, but that is shx file.

also i typed the command menu DOLOTS...

no use....:(

 

Anyway the command....dolots....is not accepting

Edited by isutheparambil
Link to comment
Share on other sites

isutheparambil

1. Attach the complete sample file.

2. Describe everything that should be in the new file.

3. Answer the questions that you are asked ...

- a polyline on a separate layer, without other elements on this layer ?

- number on a separate layer, without other elements on this layer ?

4. Read and reply to private messages.

Link to comment
Share on other sites

Ok here is the lisp and the plots dwg, I tested the code by saving into C:\temp, this is for testing only if c:\temp does not exist it will not work, you must not have the dwg named the same as a lot number. At some later stage can add where every dwg lives etc.

 

Save both of these into c:\temp plus your dwg.

 

Open your dwg then type (load "c:\\temp\\dolots") at command line. It should all just happen then it is set to 3 dwgs for testing see code for comment about line to change to do all lots, I could be wrong but found 1 lot not closed this will cause error also. I did around 20 dwgs in testing.

Plots.dwg

Dolots.lsp

Link to comment
Share on other sites

Ok here is the lisp and the plots dwg, I tested the code by saving into C:\temp, this is for testing only if c:\temp does not exist it will not work, you must not have the dwg named the same as a lot number. At some later stage can add where every dwg lives etc.

 

Maratovich your right oh I forgot about all this other stuff that I want as well.

Link to comment
Share on other sites

Ok here is the lisp and the plots dwg, I tested the code by saving into C:\temp, this is for testing only if c:\temp does not exist it will not work, you must not have the dwg named the same as a lot number. At some later stage can add where every dwg lives etc.

 

Save both of these into c:\temp plus your dwg.

 

Open your dwg then type (load "c:\\temp\\dolots") at command line. It should all just happen then it is set to 3 dwgs for testing see code for comment about line to change to do all lots, I could be wrong but found 1 lot not closed this will cause error also. I did around 20 dwgs in testing.

 

On the command menu, I cant run the command as you mention, (c:\\temp\\dolots) or load "c:\\temp\\dolots")

Please type the exact word i need to type on the command line..

ie, without space, comma like.

if space, the command will not take

so please send me the exact command only i need to type on drawing command line..

 

Oh.. Finally i got,

 

You mean that APPLOAD,,,

right?

 

Then next question

I saw the cyan framed plot... but where and how it will save as a individual plot drawing...?

Edited by isutheparambil
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...