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!
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.
Solved! Go to Solution.
Solved by pbejse. Go to Solution.
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
@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
@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 ?
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?
@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
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.
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.
@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?
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!
@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?
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
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-005, 2-SS706A-002,3-SS706A-003 this is wrong.
3) pick point should be at upper left corner, not lower left corner.