VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Measure or divide command in vba

4 REPLIES 4
Reply
Message 1 of 5
Anonymous
1838 Views, 4 Replies

Measure or divide command in vba

I want to insert a block along a polyline like measure or divide command. Is there a way to use these commands in vba ? Sukru Baykan
4 REPLIES 4
Message 2 of 5
tproby
in reply to: Anonymous

Also need this functionality but looking at other posts, it seems you have to use LISP.

Message 3 of 5
truss85
in reply to: Anonymous

first of all

you need to insert block command I send an example...

then you specified the coords. of the where the block inserted.

along a polyline I suggest get coordinate method.

if you describe your problem with details, I can help with further imformation.

here is insert block example which already existed in acad

sub is add block to (0,0,0) coordinate, you can modfiy to polyline coordinates..

 

Sub block_ekleme()
    Dim blocknesnesi As AcadBlockReference
    Dim kesisim(0 To 2) As Double
    kesisim(0) = 0: kesisim(1) = 0: kesisim(2) = 0
    Set blocknesnesi = ThisDrawing.ModelSpace.InsertBlock(kesisim, "blo", 1#, 1#, 1#, 0)
    ZoomAll
End Sub

 

Message 4 of 5
bojko108
in reply to: Anonymous

it is fairly easy to do mathematically. Here is one example. It is maybe little complex 🙂 but will give you directions how to do it. There is a way with SendCommand() method but I don't know how it works. Look in Help Menu there is plenty of examples

Message 5 of 5
kave79
in reply to: bojko108

 Nice job, however if a segment of poly line is arc you measure the distance of the cord not the real distance on curve.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost