VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

really challing work. No Idea How and What To Do? please share some idea.

9 REPLIES 9
Reply
Message 1 of 10
Anonymous
478 Views, 9 Replies

really challing work. No Idea How and What To Do? please share some idea.

Hi All.

I am getting problem. In my company there are many drawing with many Layout.
now the problem is

i need to make them seperate single drawing for each layout.

the drawing structure is like this
the drawing has some Xref in ModelSpace and other Entity
and in the layout there are 3 difference zoom scale( like 1:5 , 1:100, 1:50)
viewport also. and sheet title blocks with attribute.

Now i have to make program for to make single drawing. of each layout which
should be same setting in that drawings.

Please help What and How to do?

if i do wblock it will just use for modelspace and it will not go with paper
space layout and viewport with zoom scale.
God!!!!!!!!!! this is a really challing work for me.

Please share your idea.
i think this will be help full for every body.

Thanks.
Amrit
9 REPLIES 9
Message 2 of 10
Hallex
in reply to: Anonymous

Take a look at this page:

http://www.jtbworld.com/lisp.htm

Serach for "LayoutsToDwgs.lsp"

This should be create separate drawings of all layouts

~'J'~
_____________________________________
C6309D9E0751D165D0934D0621DFF27919
Message 3 of 10
norman.yuan
in reply to: Anonymous

If I understand what you need correctly, it just as simple as this:

1. Open the drawing
2. Delete all layout but one you want to keep;
3 Save the drawing "AS" a new name.

Say, you have drawing that contains 3 layouts (named as L1, L2 and L3).
Your code open the drawing "TheDrawing.dwg"; delete L2 and L3; save it as "TheDrawing_L1.dwg".
Then the code open the drawing "TheDrawing.dwg" again; delete L1 and L3; save it as "TheDrawing_L2.dwg".
...You can go and go to clear out all layout except for the one you want to keep and save the drawing AS whatever name you like.

The code for doing this would be fairly simple.

Norman Yuan

Drive CAD With Code

EESignature

Message 4 of 10
Anonymous
in reply to: Anonymous

Hi Norman
Thanks,Well, this is really good idea.thanks man.

yes this is a very sort way to make and seperate drawing for each layout.
But one thing. how to clean other entity which is not display on current
layout viewports.

Thanks
Amrit

wrote in message news:6296662@discussion.autodesk.com...
If I understand what you need correctly, it just as simple as this:

1. Open the drawing
2. Delete all layout but one you want to keep;
3 Save the drawing "AS" a new name.

Say, you have drawing that contains 3 layouts (named as L1, L2 and L3).
Your code open the drawing "TheDrawing.dwg"; delete L2 and L3; save it as
"TheDrawing_L1.dwg".
Then the code open the drawing "TheDrawing.dwg" again; delete L1 and L3;
save it as "TheDrawing_L2.dwg".
...You can go and go to clear out all layout except for the one you want to
keep and save the drawing AS whatever name you like.

The code for doing this would be fairly simple.
Message 5 of 10
Anonymous
in reply to: Anonymous

Hi Hallex
Thanks for reply. yes this is also way to seperate drawing. but this is not
complete at all, for seperate.
we need to clean entity which is not display on paper space layout
viewports.

any idea
thanks


wrote in message news:6296611@discussion.autodesk.com...
Take a look at this page:

http://www.jtbworld.com/lisp.htm

Serach for "LayoutsToDwgs.lsp"

This should be create separate drawings of all layouts

~'J'~
Message 6 of 10
Mario-Villada
in reply to: Anonymous

Perhaps

{code}
ThisDrawing.PurgeAll
{code}
Message 7 of 10
Anonymous
in reply to: Anonymous

Hi Mario

that is not purge

i mean to say. how to delete all ACAD Entity (object) which has in model
space but not shown in paper space layout viewports.

wrote in message news:6296917@discussion.autodesk.com...
Perhaps

{code}
ThisDrawing.PurgeAll
{code}
Message 8 of 10
Mario-Villada
in reply to: Anonymous

Sorry for the missunderstanding. here are my thoughts though.
What I would try to do if I were you is this:

1.After splitting all your layouts into separate dwgs I would open each dwg and loop through all the vports in your layout and then, get their LowerLeftCorner and UpperRightCorner properties.

2. Use TranslateCoordinates method from the utility object to get the correspondant coordinates of the viewports in model space. At this stage you would have a set of points representing the windows of your vports in model space.

3. Create a new SelectionSet object.

4.Use Select method of the newly created SelectionSet to add entities to the set, using the resulting points from the TranslateCoordinates method, and acSelectionSetCrossing mode as parameters.

5. I am not sure what to do afterwards, but the goal here would be to delete everything except for the entities in your selectionset. There might be more efficient option option but here is what I would do: i'd temporary create a new block and add the entities in your selection set to the block. then i would set the layer of this block to a locked one or hidden one (you might need to create it). and finally I would delete everything in model space that is not in a locked or off layer. but again I am not sure whether this works.

Another possibility I could think of for step 5 is to create a new SlectionSet and add everything in your model space. so now you would have 2 selection sets. One with the objects shown in your viewports, and another one with everything in modelspace. So here you could loop thorugh the first selection set, and delete each entity in your second selection set. as a result your second selection set would contain the entities you want to delete. Therefore you can delete them now.

I think this could result in a fairly complicated code, but I am convinced that it is possible to achieve what you want. Besides, in a lack of other Ideas you could give it a try.

I would love to know whether it worked.

Good luck .
Message 9 of 10
Anonymous
in reply to: Anonymous

Hi Mario.

FoA thanks for you reply. i also think that up to 3 number but i was
thinking whether there is Invert selection on ACAD.
if it is it would be very easy.

Now What i am trying to do. The stpe are below

After Step No 2

Step No 3. I am create Rectangle on model space as same as paper space
with layer "Temp Border"

Step No 4. After creating all Shape I do Wblock with base point 0,0,0 for
all Rectangle

step No 5. and Zoom Extend and Erase all with select by crossing poligon in
and purge it.
Step No 6 and import those block which we made by wblock and same coordinate

this step is not tested yet. this is jus my thought.
Like this way we are not going to loose layer, block,Xref,original
Coorninate.
i am thinking this will be not easy. Please share your idea is this
possible.

Tahnks.





wrote in message news:6297573@discussion.autodesk.com...
Sorry for the missunderstanding. here are my thoughts though.
What I would try to do if I were you is this:

1.After splitting all your layouts into separate dwgs I would open each dwg
and loop through all the vports in your layout and then, get their
LowerLeftCorner and UpperRightCorner properties.

2. Use TranslateCoordinates method from the utility object to get the
correspondant coordinates of the viewports in model space. At this stage you
would have a set of points representing the windows of your vports in model
space.

3. Create a new SelectionSet object.

4.Use Select method of the newly created SelectionSet to add entities to the
set, using the resulting points from the TranslateCoordinates method, and
acSelectionSetCrossing mode as parameters.

5. I am not sure what to do afterwards, but the goal here would be to delete
everything except for the entities in your selectionset. There might be more
efficient option option but here is what I would do: i'd temporary create a
new block and add the entities in your selection set to the block. then i
would set the layer of this block to a locked one or hidden one (you might
need to create it). and finally I would delete everything in model space
that is not in a locked or off layer. but again I am not sure whether this
works.

Another possibility I could think of for step 5 is to create a new
SlectionSet and add everything in your model space. so now you would have 2
selection sets. One with the objects shown in your viewports, and another
one with everything in modelspace. So here you could loop thorugh the first
selection set, and delete each entity in your second selection set. as a
result your second selection set would contain the entities you want to
delete. Therefore you can delete them now.

I think this could result in a fairly complicated code, but I am convinced
that it is possible to achieve what you want. Besides, in a lack of other
Ideas you could give it a try.

I would love to know whether it worked.

Good luck .
Message 10 of 10
Anonymous
in reply to: Anonymous

Have you tired the "cookie cutter trim" lisp routine?

Or select all objects and hold shift key and DESELECT all the items in the area of the viewport that you want to keep.

PS Make sure all layers are turned ON, all layers are THAWED and all layers are UNLOCKED.

..... but yes it would be good if there was an INVERT SELECTION button after making creating a selection set.

Trolling the web for one as we speak.......

Steve C.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost