AutoCAD Electrical Forum
Welcome to Autodesk’s AutoCAD Electrical Forums. Share your knowledge, ask questions, and explore popular AutoCAD Electrical topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

[VBA] How to generate a Point and a "etiquette"

5 REPLIES 5
Reply
Message 1 of 6
Nicolas.L
737 Views, 5 Replies

[VBA] How to generate a Point and a "etiquette"

Hello,

 

I would like to generate a point and an "etiquette" (I don't know the english word for that) in VBA and adding it to my block

 

I attached a picture showing what I want this is easier 😉

 

Regards,

 

Nicolas

5 REPLIES 5
Message 2 of 6
Nata_ly
in reply to: Nicolas.L

Maybe 'notes'... I don't use english ACE too.

But it's in 'Home' ribbon, Annotations... circle with an arrow under 'Size'.

Is this you looking for?

Message 3 of 6
rhesusminus
in reply to: Nicolas.L

Can you be more specific?

 

To draw some lines, and add a text to it... that I can help you with in VBA. But.. adding it to the block?

What block? Shold the lines/text be added to the block? Might make some trouble for you....

 

 


Trond Hasse Lie
AutoCAD Electrical and EPLAN expert
Ctrl Alt El
Please select "Accept Solution" if this post answers your question. 'Likes' won't hurt either. 😉
Message 4 of 6
Nicolas.L
in reply to: rhesusminus

Morning,

 

Thanks for your answer so, I will try to explain my problem:

 

I would like to have something like a connection point and a annotation referring to this point in VBA in order to be abler to generate automatically wire between this two points in VBA. If some one have example of kind of project similar I will be grateful.

 

Nata_ly : I tried "notes" and it is not that, I think this is only for annotation.
 
rhesusminus : In fact this is not only line I think and text I think, I am looking for an item acting like a wire connection. Don't worry about the block I give you a sample of my code:
 

Sub Design_1()

 

'Define the block
Dim blockObj As AcadBlock
Dim insertionPnt(0 To 2) As Double
insertionPnt(0) = 0
insertionPnt(1) = 0
insertionPnt(2) = 0
Set blockObj = ThisDrawing.Blocks.Add(insertionPnt, "CircleBlock")


' Add a circle to the block
Dim circleObj As AcadCircle
Dim center(0 To 2) As Double
Dim radius As Double
center(0) = 0
center(1) = 0
center(2) = 0
radius = 1
Set circleObj = blockObj.AddCircle(center, radius)

Set blockObj = ThisDrawing.Blocks.Add(insertionPnt, "Polyline")

 

' Define the outside of the dessin_1

Dim Point(14) As Double
Dim poly As AcadPolyline

Point(0) = 0: Point(1) = 0: Point(2) = 0
Point(3) = 80: Point(4) = 0: Point(5) = 0
Point(6) = 80: Point(7) = 60: Point(8) = 0
Point(9) = 0: Point(10) = 60: Point(11) = 0
Point(12) = 0: Point(13) = 0: Point(14) = 0

Set poly = blockObj.AddPolyline(Point)

 

' Define the attribute definition, Cette partie permet d'ajouter un attribut au bloque   

    Dim attributeObj As AcadAttribute
    Dim insertionPnt1(0 To 2) As Double
    Dim height As Double
    Dim mode As Integer
    Dim prompt As String
    Dim tag As String
    Dim value As String
   
    height = 5
    mode = acAttributeModeNormal
    tag1 = "Part_No"
    prompt1 = "What is the Part No?"
    value1 = "172.168.0.1"
    insertionPnt1(0) = 5#: insertionPnt1(1) = 5: insertionPnt1(2) = 0
   
' Define the attribute definition, Cette partie permet d'ajouter un attribut au block
    'Dim acadPT As AcadPoint
    'Dim NewPoint(2) As Double
    'NewPoint(0) = 40: NewPoint(1) = 0: NewPoint(2) = 0

 

' Insert the block MOP
    Dim blockRefObj As AcadBlockReference
    insertionPnt(0) = 150
    insertionPnt(1) = 150
    insertionPnt(2) = 0

' Add The Attribut IP¨to the Block
    Set attributeObj = blockObj.AddAttribute(height, mode, prompt1, insertionPnt1, tag1, value1)
'Ajoute le cercle au block
    Set blockRefObj = ThisDrawing.ModelSpace.InsertBlock _
    (insertionPnt, "CircleBlock", 1#, 1#, 1#, 0)
'Ajoute le rectangle au block
    Set blockRefObj = ThisDrawing.ModelSpace.InsertBlock _
    (insertionPnt, "Polyline", 1#, 1#, 1#, 0)

ZoomAll
MsgBox "Le bloque se trouve " & blockRefObj.ObjectName

End Sub

Message 5 of 6
rhesusminus
in reply to: Nicolas.L

So... In your drawing, you want to find all blocks named "CircleBlock", and connect these somehow, with an AEWIRE ?

 


Trond Hasse Lie
AutoCAD Electrical and EPLAN expert
Ctrl Alt El
Please select "Accept Solution" if this post answers your question. 'Likes' won't hurt either. 😉
Message 6 of 6
Nicolas.L
in reply to: rhesusminus

Morning rhesusminus,

 

Sorry for my late answer but yes, I think i would like to to find two circle named something like "circle_128" and "circle_3" and connect these .

Maybe with an AEWIRE, i don't realy know the different wires, I am new on AutocadElectrical.

 

Regards

 

Nicolas

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

Post to forums  

Autodesk Design & Make Report

”Boost