Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Titleblock grid macro modification 2

Status
Not open for further replies.

harlowmatt

Aerospace
Nov 11, 2014
71
0
0
US
Hi everyone,

currently our titleblock has the letters at the top and bottom and the numbers at the left and right. I am wanting to reverse this. I am new to the macro game and am struggling to do this. attached is what I believe is the section of the titleblock macro for the grid numbers and letters. Any help is appreciated. Thanks.
 
 https://files.engineering.com/getfile.aspx?folder=fd230b5c-d594-4562-b241-4f179ea4fb62&file=titleblock_grid.docx
Replies continue below

Recommended for you

Hi,

try these changes:
I have comment the original lines.
Code:
For i = Nb_CM_H To (Ruler/2/Cst_1 + 1) Step -1
    'CreateTextAF Chr(65 + Nb_CM_H - i) ,.5 * GetWidth() + (i - .5) * Cst_1,.5 * GetOffset(),"Frame_Text_Bottom_1_"&Chr(65 + Nb_CM_H - i), catMiddleCenter, 3.5
    'CreateTextAF Chr(64 + Nb_CM_H + i) ,.5 * GetWidth() - (i - .5) * Cst_1,.5 * GetOffset(),"Frame_Text_Bottom_2_"&Chr(65 + Nb_CM_H + i), catMiddleCenter, 3.5
    t=CStr(Nb_CM_H + i)
      CreateTextAF t ,.5 * GetWidth() + (i - .5) * Cst_1,.5 * GetOffset(),"Frame_Text_Bottom_1_"& t , catMiddleCenter, 3.5
	t=CStr(Nb_CM_H - i + 1)
      CreateTextAF t ,.5 * GetWidth() - (i - .5) * Cst_1,.5 * GetOffset(),"Frame_Text_Bottom_2_"& t, catMiddleCenter, 3.5
    Next
  
    For i = 1 To Nb_CM_H
      't=Chr(65 + Nb_CM_H - i)
      t=CStr(Nb_CM_H + i)
      CreateTextAF t,.5 * GetWidth() + (i - .5) * Cst_1,GetHeight() - .5 * GetOffset(),"Frame_Text_Top_1_"&t , catMiddleCenter, 3.5
      't=Chr(64 + Nb_CM_H + i)
      t=CStr(Nb_CM_H - i + 1)
      CreateTextAF t,.5 * GetWidth() - (i - .5) * Cst_1,GetHeight() - .5 * GetOffset(),"Frame_Text_Top_2_"&t , catMiddleCenter, 3.5
    Next

    For i = 1 To Nb_CM_V
      't=CStr(Nb_CM_V + i)
      t=Chr(65 + Nb_CM_V - i)
      CreateTextAF t ,GetWidth() - .5 * GetOffset(),.5 * GetHeight() + (i - .5) * Cst_2,"Frame_Text_Right_1_"&t , catMiddleCenter, 3.5
      CreateTextAF t  ,.5 * GetOffset() ,.5 * GetHeight() + (i - .5) * Cst_2,"Frame_Text_Left_1_"&t , catMiddleCenter, 3.5
      't=CStr(Nb_CM_V - i + 1)
      t=Chr(64 + Nb_CM_V + i)
      CreateTextAF t ,GetWidth() - .5 * GetOffset(),.5 * GetHeight() - (i - .5) * Cst_2,"Frame_Text_Right_1_"&t , catMiddleCenter, 3.5
      CreateTextAF t  ,.5 * GetOffset() ,.5 * GetHeight() - (i - .5) * Cst_2,"Frame_Text_Left_2"&t , catMiddleCenter, 3.5
    Next

Regards
Marc
 
Hi,

Reverse these 2 lines :
t=Chr(64 + Nb_CM_V + i)
t=Chr(65 + Nb_CM_V - i)

Modified code:
Code:
    For i = 1 To Nb_CM_V
      't=CStr(Nb_CM_V + i)
      't=Chr(65 + Nb_CM_V - i)
	  t=Chr(64 + Nb_CM_V + i)
      CreateTextAF t ,GetWidth() - .5 * GetOffset(),.5 * GetHeight() + (i - .5) * Cst_2,"Frame_Text_Right_1_"&t , catMiddleCenter, 3.5
      CreateTextAF t  ,.5 * GetOffset() ,.5 * GetHeight() + (i - .5) * Cst_2,"Frame_Text_Left_1_"&t , catMiddleCenter, 3.5
      't=CStr(Nb_CM_V - i + 1)
      't=Chr(64 + Nb_CM_V + i)
	  t=Chr(65 + Nb_CM_V - i)
      CreateTextAF t ,GetWidth() - .5 * GetOffset(),.5 * GetHeight() - (i - .5) * Cst_2,"Frame_Text_Right_1_"&t , catMiddleCenter, 3.5
      CreateTextAF t  ,.5 * GetOffset() ,.5 * GetHeight() - (i - .5) * Cst_2,"Frame_Text_Left_2"&t , catMiddleCenter, 3.5
    Next

Regards
Marc
 
Hello harlowmatt,
Can you post your complete code here, that will be of great help, I am looking for a code that will create a Table in complete sheet with zone name in each cell like from one corner A1 to end corner L40 . This code will help me to create table based on various sheet sizes.

Refer the image attached for my requirement.

Zone_Requirement_m1qnmg.png


Thank you,
Rangrao
 
Rangrao,

the screen shot of mine that you used has information that I deleted. with our facility being ITAR CONTROLLED, all the fields are links, and our company logo linked to it I would have to go in and do quite a bit of modification to the macro. at this time I unable to spend that kind of time on it. my apologies.

 
Hello Ferdo,

Actually I want a macro that will create a bigger table like this, this will useful for me during Drawing revision recording and zone specification during each time. I am expecting a tool that will create such table that will be helpful for a moment during revision recording and will create another macro to delete it or getting hided.
I hope you understood my requirement.

Hello Harlowmat,
Thanks for your reply, anyway will create separate post for my requirement, while looking at your post just had a thought of my requirement. I understand being ITAR controlled data, one cannot share. We also have same situation.. :)

Thanks,
Rangrao
 
Status
Not open for further replies.
Back
Top