For value of pi, you should use pi = 4*atan(1), where atan is inverse of trigonometric function tan. That way you get most accurate number as calculated by system. Of course, for large programs, it should be initialized once the program is loaded. Also, you can initialize variable like pi_2, 3_pi_2 etc. that represent values of pi/2, 3 pi /2. That way your program will perform better during run time.
Wonderful job I hope to learn that I am a newbie. Please I need to know an irregular shape drawing composed of lines and curves connected together. So that the coordinates are entered by form and the drawing is on the default drawing
hi thnx for this tutorial.i am a beginner in VBA-CAD. and ur tutorials r goin to help me alot...i have got an issue in running this programme.. i wrote the same code and it is running as well but at the end whn i finish entering x,y points and click GO it gives an error message tht RUN TIME ERROR-(some code) NO DATA BASE every time any programe i run i get this ,,and debugger locates at line 26 as in ur code window. i need ur help to solve this prblm plz...regards
How do I create a "ThisDrawing" in solidworks ? It is above "UserForm1" on the left . I guess that is what is needed in Solidworks to be able to do the same. Does anybody know? Magnus
is it possible to make a project that read autocad drawing and make a table with its commands (like line or curve) and starting & ending point and also put some commment in that table ??
Hi there.. Is it possible to change hatch layer via excel input through VBA? I have a plaza floor plan with each hatch for each unit (room) to represent unit type. I also have an Excel spreadsheet that contains room number in column A (001, 002, 003,..., etc) and unit type in column B (Small Shop, Food, Hypermarket, Cinema, Department Store, etc). Is is possible to update layers in AutoCAD automatically when we change unit type in column B?
CAD CAM Tutorials do you also offer short online course? Because I don't know where to start, just collecting syntax for similar case or learn one by one from the basic.
I have basic knowledge on programming. Can any one please tell me how can we make an object on Teklastructures using VBA on AutoCAD.... Say I want to create a W10x12 beam this way. Is it possible...
You have to create a button with a caption like Select ... and on the click event of that button write code me.hide. Untested. I did extensive programming in AutoCAD VBA nearly fifteen years back so I don't recall exactly what was the code, but you can give a try.
Instead of line, you need to define a polyline object. You should have a length of array equal to number of vertices in polyline times 3 (each one represents X, Y & Z). See code below. UNTESTED '======================== Dim plineObj as AcadPolyline Dim pt1 as variant Dim pt(0 to 11) as Double 'Calculate value of point pt1 = ThisDrawing.Utility.GetPoint(,"Lower left corner: ") 'Point 1 (Lower left corner) pt(0) = pt1(0) pt(1) = pt1(1) pt(2) = pt1(2) 'Point 2 (Lower right corner) pt(3) = pt(0) + Val(TextBox1.Text) 'TextBox1 represents Length pt(4) = pt(1) pt(5) = pt(2) 'Point 3 (Upper right corner) pt(6) = pt(3) pt(7) = pt(4) + Val(textbox2.Text) 'TextBox2 represents Height pt(8) = pt(5) 'Point 4 (Upper left corner) pt(9) = pt(0) pt(10) = pt(1) + Val(textbox2.Text) 'TextBox2 represents Height pt(11) = pt(2) Set plineObj = Thisdrawing.ModelSpace.AddPolyline(pt) plineObj.Closed = True Set plineObj.Cloded = True '======================== Good luck with programming and have fun.
Thank you very much for your time and cool video!
You're welcome
For value of pi, you should use pi = 4*atan(1), where atan is inverse of trigonometric function tan. That way you get most accurate number as calculated by system. Of course, for large programs, it should be initialized once the program is loaded. Also, you can initialize variable like pi_2, 3_pi_2 etc. that represent values of pi/2, 3 pi /2. That way your program will perform better during run time.
For the first step it.s very good introduction Good job and Thanks
More will be very welcome 🙏
This is just what I was looking for, thanks for uploading!
Hi. Thank you. this helps me to create my first program. How to add this userform to a custom tool bar?
Thank you, this worked great even in AutoCAD 2000i
Thank you so much Sir ...it was excellent for which i was searching...
good job
Thank you 😊❤️
Wonderful job I hope to learn that I am a newbie.
Please I need to know an irregular shape drawing
composed of lines and curves connected together.
So that the coordinates are entered by form and
the drawing is on the default drawing
Great video tutorial. Keep it up!
hi thnx for this tutorial.i am a beginner in VBA-CAD. and ur tutorials r goin to help me alot...i have got an issue in running this programme.. i wrote the same code and it is running as well but at the end whn i finish entering x,y points and click GO it gives an error message tht RUN TIME ERROR-(some code)
NO DATA BASE
every time any programe i run i get this ,,and debugger locates at line 26 as in ur code window. i need ur help to solve this prblm plz...regards
please prepare and create a lisp for road cross sections
Hi!!
how to create macros to perform any type of object alignment in the environment?
How can I do the quantity takeoff and export it to excel (For brickwork ,tiling etc).
Great Video !!!...... Is posible to make an ARRAY using macros ?.... There is some Books o documents about Macros Excel with AutoCAD ?....
Bye !
How can we plot a road cross section with lisp command
nice tutorial. I'm getting into VBA for autoCAD. do you have any books or sites?
How do I create a "ThisDrawing" in solidworks ?
It is above "UserForm1" on the left .
I guess that is what is needed in Solidworks to be able to do the same.
Does anybody know?
Magnus
Hello. Is it possible to convert the VBA file to a standalone exe cad file?
Hi, i would like to read a text with vba and present it in a textbox in my userform. Can you say me the macro for that?
hello ... how to create a login form in Autocad? so when opening auticad you have to login first.
Nice
HelloI want help regarding VBA program error..After running program the following error display'Compile error- User-define type not defined'
is it possible to make a project that read autocad drawing and make a table with its commands (like line or curve) and starting & ending point and also put some commment in that table ??
Yes this is possible
Thank you very much, "I want to know how to load a VBA module in AutoCAD 2018."
I have gone over this tutorial multiple times and it keeps giving me a Run-time error '424': Object Required. please tell me why this is? Thank you
very good sirji. thanks
Hi there..
Is it possible to change hatch layer via excel input through VBA?
I have a plaza floor plan with each hatch for each unit (room) to represent unit type. I also have an Excel spreadsheet that contains room number in column A (001, 002, 003,..., etc) and unit type in column B (Small Shop, Food, Hypermarket, Cinema, Department Store, etc).
Is is possible to update layers in AutoCAD automatically when we change unit type in column B?
It is possible, but you will have to write code for it.
CAD CAM Tutorials do you also offer short online course? Because I don't know where to start, just collecting syntax for similar case or learn one by one from the basic.
Hi - can you do a tutorial on drawing a around that rectangle please?
Great
Thank you.
I have basic knowledge on programming.
Can any one please tell me how can we make an object on Teklastructures using VBA on AutoCAD....
Say I want to create a W10x12 beam this way. Is it possible...
It doesn't work. error 424 object required. Basically pt2 cannot read the value from pt1
I use Visual 6 and I want to import the block name of Alaotkad Code
Is there a course teaching linking Visual 6 Balaotocad
hi can you create hatch to that rectangle using vba
Yes, we can create hatch using vba.
Have programming developer course for autocad civil 3D, video or online.
can you help me VBA
use full for create a design program
Hello.
Can you do this in solidworks for us.
Thanks.
Magnus
do u still need help on soliworks customization.i can help
+Subir Dutta
Is there a video on youtube when they do the same in Solidworks?
dear sir, I need to create on VBA Program please help me...
What if I want to define starting point (pt1) in user form. How would I define pt1 coordinates. Can you write me code for that pls?
Thanx for video.
You have to create a button with a caption like Select ... and on the click event of that button write code me.hide.
Untested.
I did extensive programming in AutoCAD VBA nearly fifteen years back so I don't recall exactly what was the code, but you can give a try.
wow. helpful
good
people to ask programmers rectangle 1listbox and 1 textbox and how ?
how to addpolyline instead of line????
Instead of line, you need to define a polyline object.
You should have a length of array equal to number of vertices in polyline times 3 (each one represents X, Y & Z).
See code below. UNTESTED
'========================
Dim plineObj as AcadPolyline
Dim pt1 as variant
Dim pt(0 to 11) as Double
'Calculate value of point
pt1 = ThisDrawing.Utility.GetPoint(,"Lower left corner: ")
'Point 1 (Lower left corner)
pt(0) = pt1(0)
pt(1) = pt1(1)
pt(2) = pt1(2)
'Point 2
(Lower right corner)
pt(3) = pt(0) + Val(TextBox1.Text) 'TextBox1 represents Length
pt(4) = pt(1)
pt(5) = pt(2)
'Point 3
(Upper right corner)
pt(6) = pt(3)
pt(7) = pt(4) + Val(textbox2.Text) 'TextBox2 represents Height
pt(8) = pt(5)
'Point 4 (Upper left corner)
pt(9) = pt(0)
pt(10) = pt(1) + Val(textbox2.Text) 'TextBox2 represents Height
pt(11) = pt(2)
Set plineObj = Thisdrawing.ModelSpace.AddPolyline(pt)
plineObj.Closed = True
Set plineObj.Cloded = True
'========================
Good luck with programming and have fun.
GOOD
how to remove password from VBA file
hey please send me study documents..thnx:))