0% found this document useful (0 votes)
16 views1 page

VBA Part60

The document describes how to define a matrix to specify the coordinates of a point in AutoCAD and use it to add a point to the drawing. It defines a 3x1 matrix called "location" and assigns values of 5, 5, 0 to the coordinates. It then uses the "AddPoint" method to add a point object to the drawing with those coordinates. Running the program draws the point, which is visible after closing and reopening the drawing.

Uploaded by

a.ahmadi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views1 page

VBA Part60

The document describes how to define a matrix to specify the coordinates of a point in AutoCAD and use it to add a point to the drawing. It defines a 3x1 matrix called "location" and assigns values of 5, 5, 0 to the coordinates. It then uses the "AddPoint" method to add a point object to the drawing with those coordinates. Running the program draws the point, which is visible after closing and reopening the drawing.

Uploaded by

a.ahmadi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

‫‪41‬‬ ‫رﺳﻢ ﺷﻜﻞﻫﺎي ﮔﻮﻧﺎﮔﻮن‬

‫‪ .6‬ﺳﭙﺲ ﻳﻚ ﻣﺎﺗﺮﻳﺲ )ﻳﻚ در ﺳﻪ( را ﺑـﺮاي ﺗﻌﻴـﻴﻦ ﻣﺨﺘﺼـﺎت ﻧﻘﻄـﻪ ﺑـﻪ ﻋﻨـﻮان ‪Double‬‬
‫ﺗﻌﺮﻳﻒ ﻣﻲﻛﻨﻴﻢ‪:‬‬
‫‪Dim location (0 To 2) As Double‬‬
‫‪ .7‬ﻣﺘﻐﻴﺮﻫﺎ را ﻣﻘﺪار دﻫﻲ ﻣﻲﻛﻨﻴﻢ‪:‬‬
‫‪Location (0) = 5: location (1) = 5: location (2) = 0‬‬
‫ﻧﻜﺘﻪ‪ :‬ﻫﻤﻮاره در ﺗﻌﺮﻳـﻒ ﻣﺘﻐﻴﺮﻫـﺎي ﺗﻌﻴـﻴﻦ ﻣﺨﺘﺼـﺎت‪ ،‬ﻣﺎﻧﻨـﺪ )‪ ، location (0 To 2‬ﻣﺘﻐﻴـﺮ‬
‫ﺷﻤﺎرهي ‪ 0‬ﺑﻪ ﻋﻨﻮان ‪ 1 ،x‬ﺑﻪ ﻋﻨﻮان ‪ y‬و ‪ 2‬ﺑﻪ ﻋﻨﻮان ‪ z‬ﺑﻪ ﻛﺎر ﻣﻲروﻧﺪ‪.‬‬
‫‪ .8‬ﺑﺮاي اﺿﺎﻓﻪ ﻛﺮدن ﻧﻘﻄﻪاي ﺑـﺎ ﻣﺸﺨﺼـﺎت ﻓـﻮق ﺑـﻪ ﺻـﻔﺤﻪي اﺗﻮﻛـﺪ )‪ (Model Space‬از‬
‫دﺳﺘﻮر زﻳﺮ اﺳﺘﻔﺎده ﻣﻲﻛﻨﻴﻢ‪:‬‬
‫)‪Set pointObj = ThisDrawing.ModelSpace.AddPoint(location‬‬
‫‪Thisdrawing.application.update‬‬
‫‪ZoomAll‬‬
‫‪ .9‬ﺑﻌﺪ از اﺟﺮاي ﺑﺮﻧﺎﻣﻪ )ﻛﻠﻴﺪ ‪ (F5‬و ﻓﺸﺮدن دﻛﻤﻪ‪ ،‬ﻧﻘﻄﻪ رﺳﻢ ﻣﻲﮔﺮدد‪ .‬ﺑﻌﺪ از ﺑﺴﺘﻦ ﺑﺮﻧﺎﻣﻪ‬
‫و ﺑﺮﮔﺸﺖ ﺑﻪ ﻣﺤﻴﻂ اﺗﻮﻛﺪ‪ ،‬ﻧﻘﻄﻪي رﺳﻢ ﺷﺪه ﻣﺸﺎﻫﺪه ﻣﻲ ﺷﻮد‪.‬‬
‫‪ .10‬ﺑﺮاي ذﺧﻴﺮه ﻛﺮدن ﺑﺮﻧﺎﻣﻪ‪ ،‬ﺑﻪ ﻣﻨﻮي ‪ File‬ﺑﺮوﻳﺪ و ﮔﺰﻳﻨﻪي ‪ Save‬را اﻧﺘﺨﺎب ﻛﻨﻴﺪ‪.‬‬

‫ﺷﻜﻞ ‪ 2-10‬ﺑﺮﻧﺎﻣﻪي رﺳﻢ ﻧﻘﻄﻪ‬

You might also like