Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Arrangement drawings

21 REPLIES 21
SOLVED
Reply
Message 1 of 22
emk2012
620 Views, 21 Replies

Arrangement drawings

Hi guys

At "Mode space" , I have some drawing. maybe is not the same as the size of the drawing frame .
I need to arrange them neatly by drawing No. (eg;1-SS706A-003).

I hope can set Columns
Can set Row spacing and columns spacing too!

 

I appriciate your help!

 

20140918091710.jpg

 

 

For a while before , Mr.hmsilva helped me write a code about "batch insert Xref and Arrangement" (Very grateful)

This have some different, No need insert, The object is not Xref. only need arrangement.

sorry! I don't understand programming, so Need help again !Many thanks!

 

Drawing frame is not the same ,See Attachments.

21 REPLIES 21
Message 2 of 22
emk2012
in reply to: emk2012

Someone give advice ,maybe need Bounding Box. Man Indifferent

Message 3 of 22
pbejse
in reply to: emk2012


@emk2012 wrote:

Someone give advice ,maybe need Bounding Box. Man Indifferent


Is the sample that you attached [test2.dwg] on the first post represents what the actual layout looks like now? are those "DRWBOX****" blocks and contents are what  you are  wanting to arrange?

Message 4 of 22
emk2012
in reply to: pbejse

Thanks pBe

you are right. A row  a column is arranged neatly 

Message 5 of 22
pbejse
in reply to: emk2012


@emk2012 wrote:

Thanks pBe

you are right. A row  a column is arranged neatly 


Ok, now, on your sample. when done manually, how would it look like? can you show us the end result?

Message 6 of 22
emk2012
in reply to: pbejse

ok! see attachment.

 

I set Column= 5, column spacing=100, row spacing=100

 

Use Drawing number from left to right, from top to bottom of the order arrange 

Message 7 of 22
emk2012
in reply to: emk2012

I forgot , must pick a baskpoint for arrangement.Man Sad

Message 8 of 22
emk2012
in reply to: pbejse


@pbejse wrote:

@emk2012 wrote:

Thanks pBe

you are right. A row  a column is arranged neatly 


Ok, now, on your sample. when done manually, how would it look like? can you show us the end result?


 

Dear pBe. 

Would you help me?

Message 9 of 22
pbejse
in reply to: emk2012


@emk2012 wrote:

Dear pBe. 

Would you help me?


I saw the same ropic on a different forum emk2012, thought they already gave you a solution or at leaast a reference?

 

Honestly, on your sample, i still have not figure out as what colum/row the blocks and its contents belongs to. It will end up with a lot of guesswork on my end is what i'm saying. Until i have a full grasp of whats need to be done i wouldnt be able to write a acceptable solution.

 

If you want to elaborate more then i will be happy to help you emk2012

Message 10 of 22
emk2012
in reply to: pbejse


@pbejse wrote:

I saw the same ropic on a different forum emk2012, thought they already gave you a solution or at leaast a reference?

 

Honestly, on your sample, i still have not figure out as what colum/row the blocks and its contents belongs to. It will end up with a lot of guesswork on my end is what i'm saying. Until i have a full grasp of whats need to be done i wouldnt be able to write a acceptable solution.

 

If you want to elaborate more then i will be happy to help you emk2012



 

 

Hi pBe ,I post this topic at cadtutor too. but get reply I don't really understand. and I don't understand programming. 

 

my attachment "test2.dwg" 

 

arrange them by drawing No. From left to right,From top to bottom .

eg.

001,002,003,004,005

006,007,008,009,010

 

I hope can set Columns , Row spacing and column spacing .

in test2.dwg , you can see the columns=5, rowspacing=100, columnspacing=100 

 

sorry for my poor english. Did you understand now ?

2014-9-20 8-50-57.png

Message 11 of 22
pbejse
in reply to: emk2012


emk2012 wrote:

.... arrange them by drawing No. From left to right,From top to bottom .

eg.

001,002,003,004,005

006,007,008,009,010

 

I hope can set Columns , Row spacing and column spacing .

in test2.dwg , you can see the columns=5, rowspacing=100, columnspacing=100 

 

sorry for my poor english. Did you understand now ?


Think i do, Let see what i can do. hang in there.

 

EDIT: BTW how may of these drawings do you need to arrange? I'm asking vecause does it merit writing a code for such a task? 

Also. are you wanting to select everything on model space or you prefer via selection?

 

 

Message 12 of 22
emk2012
in reply to: pbejse



@pbejse wrote:

Think i do, Let see what i can do. hang in there.

EDIT: BTW how may of these drawings do you need to arrange? I'm asking vecause does it merit writing a code for such a task? 

Also. are you wanting to select everything on model space or you prefer via selection?



Thanks pBe.
1.maybe 300~ 500 drawings.
2.I prefer via selection


 

 

 


 

Message 13 of 22
pbejse
in reply to: emk2012


emk2012 wrote:
Thanks pBe.
1.maybe 300~ 500 drawings.
2.I prefer via selection

Problem with this kind of task , it tends to be too specific and unique only to the OP <original post/poster>  

 

Before i even start to write a code, you must lay down all your cards on the table, 

 

Are there any other title blocks that are not prefixed with "DRWBOX****" on any of the 300-500 drawings you need to process? ? or drawing info blocks that are not "TitleBar"? 

 

Any other additional info that we should know about?

 

Pseudo code

 

IF AND
      Selected object
      Enter number of columns
      Enter Row distance
      Emter Column distance
      pick point
      	  THEN
  		Separate Tblock boundaries and its contents
  		Determine the order using info from "TitleBar"
  		Determine how many Rows using total "boundaries" and user input number of columns
		FOREACH
		Move collected objects to its new position
		Re-assign new value for base point

 

I think thats how i would approach the problem.

Message 14 of 22
emk2012
in reply to: pbejse


pbejse wrote:

Are there any other title blocks that are not prefixed with "DRWBOX****" on any of the 300-500 drawings you need to process? ? or drawing info blocks that are not "TitleBar"? 

Under normal circumstances is not there.

Kinds too much, programming can be very complicated 

 

Pseudo code

IF AND
      Selected object
      Enter number of columns
      Enter Row distance
      Emter Column distance
      pick point
      	  THEN
  		Separate Tblock boundaries and its contents
  		Determine the order using info from "TitleBar"
  		Determine how many Rows using total "boundaries" and user input number of columns
		FOREACH
		Move collected objects to its new position
		Re-assign new value for base point

 


Yes ! very good! Thank you so much ! pBe. 

Message 15 of 22
pbejse
in reply to: emk2012


@emk2012 wrote:

@pbejse wrote:

Are there any other title blocks that are not prefixed with "DRWBOX****" on any of the 300-500 drawings you need to process? ? or drawing info blocks that are not "TitleBar"? 

Under normal circumstances is not there.

Kinds too much, programming can be very complicated


Not sure what you mean by that emk2012, is that YES there are tblocks used under a different name? Program i had in mind will target tblocks with DRWBOX prefix? and it should have "TitleBar" info block inside of it, otherwise it would be ignored.

 


@emk2012 wrote:
Kinds too much, programming can be very complicated 

 

Pseudo code.... 


Yes ! very good! Thank you so much ! pBe. 


Does that mean you are going to try to write a code based on the posted pseudo code? If yes, tell us how it goes ok?

 

Message 16 of 22
emk2012
in reply to: pbejse

sorry! pBe ,sorry for my poor English.

 

I mean

if ignore blocks. It is Universal. my drawing as you see is use blocks.("DrawingBox" and"TitleBar" is blocks)  But my colleague didn't use block .

so. you decide! 

 


Does that mean you are going to try to write a code based on the posted pseudo code? If yes, tell us how it goes ok?


 

NO,you know I don't understand programming ,I think your idea is good , I am waiting for your help !

I had a dream last night ,I dreamed that you help me completed it. and I test ,It's very good! haha!

Message 17 of 22
pbejse
in reply to: emk2012


@emk2012 wrote:

 

I mean if ignore blocks. It is Universal. my drawing as you see is use blocks.("DrawingBox" and"TitleBar" is blocks)  But my colleague didn't use block .


so. you decide! 


Then, the routine will exclusively use for the condtion i set above.

 


@emk2012 wrote:

 

 I had a dream last night ,I dreamed that you help me completed it. and I test ,It's very good! haha!


You give way too much credit emk2012, One last question, Why is your drawing not on UCS world? will it be always like that? 

 

Message 18 of 22
emk2012
in reply to: pbejse


@pbejse wrote:

 


You give way too much credit emk2012, One last question, Why is your drawing not on UCS world? will it be always like that? 


 

some times it's not UCS world . because , some times will use" _dimordinate" , It's will specify new origin point.(COMMAND: UCS->M)

Message 19 of 22
pbejse
in reply to: emk2012

Try the attached code |||  Works exclusively under the conditions I set from the previous posts ||| 
command: arrange
(defun c:arrange (/        pbe:Inside-p      _bndbx   _dxf     TheRest
                  Tblocks  ss       bp       bpp      data     row
                  ln
                  )
  (defun pbe:Inside-p (a b c)
;;; http://mathforum.org/library/drmath/view/54386.html ;;;
;;; (.5)(x1*y2 - y1*x2 -x0*y2 + y0*x2 + x0*y1 - y0*x1)	;;;
.........
COMPLETE CODE AS ATTACHMENT TO THIS THREAD
.........
        (setq bp  bpp
              bp  (polar bp (/ pi 2.0) (+ vertd RSd))
              bpp bp
              )
        )
      )
    )
  (princ)
  )

 HTH

 

Message 20 of 22
emk2012
in reply to: pbejse

Thank you very much! pBe, great!

I found several problems .

1)I set Column spacing=100,But actual is 200 ,(2 magnification), I set 200, actual is 400

2) Sort problems, sort by the last three digits of drawing No.

eg. 

1-SS706A-001,2-SS706A-002,3-SS706A-003, 1-SS706A-004,1-SS706A-005  this is right.

1-SS706A-001,1-SS706A-004,1-SS706A-0052-SS706A-002,3-SS706A-003  this is wrong.

 

3) pick point should be at upper left corner, not lower left corner.

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

Post to forums  

Autodesk Design & Make Report

”Boost