Measure or divide command in vba

Measure or divide command in vba

Anonymous
Not applicable
2,350 Views
4 Replies
Message 1 of 5

Measure or divide command in vba

Anonymous
Not applicable
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
0 Likes
2,351 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable

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

0 Likes
Message 3 of 5

Anonymous
Not applicable

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

 

0 Likes
Message 4 of 5

Anonymous
Not applicable

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

0 Likes
Message 5 of 5

Anonymous
Not applicable

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

0 Likes