Hi, iam trying to write a macro in vba that can shiw me a msg about a select segment label for parcel (Eg. L1)
As soon as i activate the macro, it asks me to select a label segment and it gives me the following information
* Segmente name (L1)
* Start easting
* start northing
* azimuth
*segment lengh
*end easting
*end northing
Hi,
I'm not sure how familiar you are with VBA programming and macros.
The Parcel Segment object contains the name and a list of segments elements, which contains the geometry information:
http://docs.autodesk.com/CIV3D/2012/ENU/API_Reference_Guide/com/AeccXLandLib__IAeccParcelSegment.htm
Do you have anything already?
Hi, Augusto, iam not so familiar with macros, iam going to start going deep in near future, so for this time i just would like a macro code to use in a userform iam buildind that can give me the msgs i have mentioned
When i click the command botton it has to ask me to select the label segment (general line label stile) as soon as i select i can see can be in a textbox the messages of the informations i have mentioned before.
Just to clarify, i atached an image, the iformation i have in the table is the one i want to appear in the msg or even in a textbox
Remember that iam not so familiar with macros, iam starting reading the reference guides you have mentioned
Rosario Dilo (Regards)
Hi August I could write the macro like this, so the problem is that i Can not read the results (StartX, StartY, EndX, EndY, Length, ParcelSegment )
As shown below, i would like to show the result in TextBox14
Private Sub ToggleButton3_Click()
' Loop through all elements used to make parcel "oParcel"
UserForm1.Hide
Dim i As Integer
Dim vPt As Variant
Dim oEnt As AcadEntity
Dim oLblSrc As AeccParcelSegmentLabel
Dim oLblDest As AeccParcelSegmentLabel
Dim oElement As AeccParcelSegmentElement
ThisDrawing.Utility.GetEntity oEnt, vPt, vbCr & "Selecione a confrontação a direita: "
If TypeOf oEnt Is AeccParcelSegmentLabel Then
Set oLblsrc=oEnt
ThisDrawing.Utility.GetEntity oEnt, vPt, vbCr & "Select label to "
If TypeOf oEnt Is AeccParcelSegmentLabel Then
Set oLblDest = oEnt
oLblDest.LineLabelStyle = oLblSrc.LineLabelStyle
End If
Debug.Print "Element " & i _
& " of segment " & oElement.ParcelSegment.Name & ": " _
& oElement.StartX & "," & oElement.StartY & " to " _
& oElement.EndX & ", " & oElement.EndY
If (TypeOf oElement Is AeccParcelSegmentLine) Then
Dim oSegmentLine As AeccParcelSegmentLine
Set oSegmentLine = oElement
Debug.Print " is a line. "
ElseIf (TypeOf oElement Is AeccParcelSegmentCurve) Then
Dim oSegmentCurve As AeccParcelSegmentCurve
Set oSegmentCurve = oElement
Debug.Print " is a curve with a radius of:" _
& oSegmentCurve.Radius
End If
End If
TextBox14 = oElement.EndX
UserForm1.show
End Sub
@ramd401, I don't see where you are setting the oElement. The Label object in COM does not have a way to obtain the object it is labeling (.NET does). As long as you can get the actual ParcelSegmentElement, then you will be able to show the data you wish to see.
Can you zip up the DVB you are using to allow us to look over the actual code you are testing with?
Hi Jeff the thing is that i do not know how to setting the oElement in it, can you give me a hand where to do that?
Rosario Dilo
Hi, As i mentioned in the first post iam still new im VBA nevertheless iam still working on the project giving name in the commnads and organize the codes. So the botton i need help now is the one with description "Ler esq." (I mean read the left segment label " L1 ") it has already the codes so when i click the segment label i would like it to see in the Textbox14 the (Start easting, start northing, length, azimuth, end easting and end northing).
After that as i sad i can start rewrite the macros with more organization and proper name for comboboxes, textboxes and others.
Remember: for the moment i need help for the botton i have mentioned before.
Rosario Dilo
Regards
So in this case, do you think i can get this results from polylines or lines?
If So what do you sugest as macro?