Arc vb6

Started by casf2012, October 22, 2014, 04:30:28 AM

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

casf2012

Hello

Anyone can tell me if there is a way to get angle of a arc?

or if there is a way to change from convex to concave or concave to convex using vb6

thanks in advance

best regards,

Carlos Ferreira

DrollTroll

Use the Entity.EntityDataObject method to get specific details on different entity types. For arcs, the EntCircle object (returned by the EntityDataObject method) has the SpanAngle property.

To complement one or more arcs, select them, then use the Selection.ComplementArcs method.
25 years with DesignCAD

casf2012

thanks

by the way can you tell me how can i use the option mirror ?

or if there's a way to execute commands in vb6 to designCad?

thanks in advance,

best regards,
Carlos Ferreira

DrollTroll

Sorry I don't quite understand either of those questions.
25 years with DesignCAD

Juergen

Carlos,

this works fine:

        Dim DcECircle As DesignCAD.EntCircle
        DcECircle = DcEnt.EntityDataObject
        MsgBox(DcECircle.SpanAngle)
      
See attachment for example output.

You can execute DC macros this way:

        Dim retval As Boolean
        Dim mymacro As String
      ' path is public
        mymacro = path + "\dcc\macros\" + "macro.d3m"
        ' DcApp.ErrorCode = 0
        retval = DcDoc.RunBasicCAD(mymacro)

Kind regards,

Juergen      

Juergen

> by the way can you tell me how can i use the option mirror ?

Carlos,

do you mean something like this?

        Dim FindResult As Long
        DcDoc.ShowCommandDialog = False
        DcSel = DcDoc.Selection

        FindResult = DcSel.FindFirstItem(DcEnt, 0)
     
        If FindResult < 0 Then
            Beep()
            MessageBox.Show(Me, "Please select an object.")
            Exit Sub
        End If
        DcSel.Mirror(DesignCAD.DcCommandAxes.dcCommandXAxis, False, False)
        DcDoc.ShowCommandDialog = True

Juergen

casf2012

Juergen,

Thanks for the help.

That's just what I needed.

just would like to know how and what the subject at a fixed distance from the original

kind regards,

Carlos Ferreira

Juergen

Quotejust would like to know how and what the subject at a fixed distance from the original

Whew, prl please translate ;)

Are you talking about dimension functions? Please explain.

... Just saw your drawing:
You could do something like this:

   DcDim = DcDoc.Dimension
        DcDim.ExtensionOvershoot = 0.001
        DcDim.ExtensionGap = 0
        DcDim.TextSize = mx  ' to be calculated
        DcDim.ExtensionLength = 0
        DcDim.Alignment = 4
        DcDim.SuffixText = " m"
        DcDim.Draw()

You can select center of circle1, then center circle 2 and calculate the distance in
case you know the radiuses. Not sure I got it.
      
Kind regards,

Juergen

casf2012

Juergen,

thanks for the help,

let me explain

1. -> i want select the arc or the line automatic and after do the mirror.
2. -> i want that the copy separated from the original X pixels

kind regards,
Carlos Ferreira


Juergen

Try to get the center of each arc/circle (original and mirrored),
calculate and draw the line:

You get the center with something like this:

        Dim CircObj As Object
        CircObj = DcCircle.Draw()
      
        Dim X As Double, Y As Double, Z As Double
        Dim DcEnt As DesignCAD.Entity
        Dim DcEnts As DesignCAD.Entities
        Dim obj As DesignCAD.EntCircle      
        DcEnts = DcDoc.Entities
        DcEnt = DcEnts.GetEntityByID(CircObj)
        obj = DcEnt.EntityDataObject
        obj.GetCenter(X, Y, Z)
        MsgBox("Here we are:" & X & ", " & Y & ", " & Z)
      
Kind regards,

Juergen   

prl

Quote from: Juergen on October 27, 2014, 10:46:32 AM
Quotejust would like to know how and what the subject at a fixed distance from the original

Whew, prl please translate ;)

In Google Translate vertrauen wir. Offenbar eine schlechte Übersetzung.    Ich weiß es auch nicht.

In Google Translate  we trust.         Apparently a bad  Google Translation.     I don't know either.      :D

casf2012

Juergen,

thanks for the help. 8)

i calculated the values manually with  functions

with this :

If vfIsSymmetric = True Then
    viValue = vfYFirstPoint + vfDistance
ElseIf vfIsSymmetric = False Then
    If vfYSecondPoint < vfYFirstPoint Then
        viValue = (vfYFirstPoint + vfDistance) - (vfYSecondPoint - vfYFirstPoint)
    Else
        viValue = (vfYFirstPoint + vfDistance) - Math.Abs((vfYFirstPoint - vfYSecondPoint))
    End If
End If

kind regards,

Carlos Ferreira