Jump to content

Recommended Posts

Posted

Can anybody set me on the right path to get started on VBA. I need tutorials. Tutorials for first timmers! ((step by step))... I'm using AutoCAD 2009. I need to get up and running.

 

regards,

 

DECHAL

Posted

VBA is dead. If you don't already know it, I would suggest not wasting time trying to start now. Depending on what you are trying to do, you could either use lisp or .NET

 

Having said that, http://www.afralisp.net/ has some tutorials on lisp and VBA. With .NET, it depends on whether you want to use VB or C# or F# or....

Posted

Thanks for info.

 

What I have is a beam with a fitting on each end. The beam can be verious lengths and the fitting on each end can be many. I want a way to insert the beam and select length and which fitting I need on beam.

 

Regards,

 

DECHAL

Posted

That almost sounds like an application for a dynamic block. Have you considered that?

Posted

Cheers Lee,

 

That what I'm looking for.

 

DECHAL

Posted

here is the code I started developing. It is nowhere near complete but shows that you can influence the dynmic properties immediately after insertion. I don't think you can do it before.

Private Sub TerminalRail()
Dim BlockRefObj As AcadBlockReference
Dim BlockPos As Variant
Dim PropList As Variant
BlockPos = ThisDrawing.Utility.GetPoint(, "Block position ")
Set BlockRefObj = ThisDrawing.ModelSpace.InsertBlock(BlockPos, "TerminalRail TS35", 1!, 1!, 1!, 0)
PropList = BlockRefObj.GetDynamicBlockProperties
PropList(0).Value = 77.5 'distance
PropList(2).Value = 375#  'length
ThisDrawing.Regen acActiveViewport
   
End Sub

 

you might as well have the block to play with too.

TerminalRail TS35.dwg

Posted
Cheers Lee,

 

That what I'm looking for.

 

DECHAL

 

No Probs, if you check the related pages on the home page of CADTutor, you will find more links also :thumbsup:

Posted

Dave,

 

Thanks for the code/dwg.

 

Just a quick Question. How do i get it to work? Is it "Load Application". Nothing seems to be happening.

 

Any pointers?

 

Regards,

 

DECHAL.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...