Results 1 to 4 of 4

Thread: How to make "dynamic" move object on screen(like acad comand move or copy).

  1. #1
    Member
    Join Date
    2008-12
    Posts
    2
    Login to Give a bone
    0

    Default How to make "dynamic" move object on screen(like acad comand move or copy).

    Hi.

    I have little problem(i write simple program which drawing few lines) and I wonder if it is possible to make "dynamic" move this lines to point that i choose on screen (with showing this lines on screen too).

    If someone have any idea or link to place where i can find any info would be great (full program would be best option ;] ).

    THX.

  2. #2
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,397
    Login to Give a bone
    0

    Default Re: How to make "dynamic" move object on screen(like acad comand move or copy).

    Sorry, the vba api doesn't support that. You need to use jigs in .NET.
    C:> ED WORKING....

  3. #3
    Member
    Join Date
    2008-12
    Posts
    2
    Login to Give a bone
    0

    Default Re: How to make "dynamic" move object on screen(like acad comand move or copy).

    Quote Originally Posted by Ed Jobe View Post
    Sorry, the vba api doesn't support that. You need to use jigs in .NET.
    Can you write something more about that problem (where i can find any more information about that problem), i learn everything about vba from books and website. Im not programer.

    Thx.

  4. #4
    AUGI Addict fixo's Avatar
    Join Date
    2005-05
    Location
    Pietari, Venäjä
    Posts
    1,269
    Login to Give a bone
    0

    Default Re: How to make "dynamic" move object on screen(like acad comand move or copy).

    I know this isn't good idea to use SendCommand
    but this code is working for me:

    Code:
    Option Explicit
    
    Sub MoveEnt()
    
        Dim oEnt As AcadEntity
        Dim pickPt As Variant
        Dim fpt As Variant
        Dim osm As Integer
        On Error GoTo Err_Control
    
        ThisDrawing.Utility.GetEntity oEnt, pickPt, vbCrLf & "Select object to move >> "
        If oEnt Is Nothing Then Exit Sub
        On Error GoTo Err_Control
    
        With ThisDrawing
            osm = .GetVariable("OSMODE")
            .SetVariable "OSMODE", 513    '// <-- change snap setting to your needs
            fpt = .Utility.GetPoint(, "Pick first point")
    
            If IsEmpty(fpt) Then
                GoTo Exit_Here
            End If
    
        End With
    
        Dim strh As String, strp1 As String
        strh = oEnt.Handle
        strp1 = Replace(CStr(fpt(0)), ",", ".") & "," & _
                Replace(CStr(fpt(1)), ",", ".") & "," & _
                Replace(CStr(fpt(2)), ",", ".")
    
        ThisDrawing.SetVariable "CMDECHO", 0
        ThisDrawing.SendCommand "-OSNAP _NONE "
        ThisDrawing.SendCommand "_MOVE " & _
                                "(handent " & Chr(34) & strh & Chr(34) & ")" & vbCr & _
                                vbCr & strp1 & vbCr & "pause" & vbCr
    
    Exit_Here:
    
        With ThisDrawing
            .Regen acActiveViewport
            .SetVariable "OSMODE", osm
            .SetVariable "CMDECHO", 1
        End With
    
    Err_Control:
        If Err.Number <> 0 Then
            MsgBox Err.Description
            Resume Exit_Here
        End If
    
    End Sub
    ~'J'~

Similar Threads

  1. Mover um objeto, sem utilizar o comando "move" no lisp
    By Edmar Cristiano in forum AutoLISP
    Replies: 1
    Last Post: 2013-07-30, 02:28 AM
  2. 2012: Move "Educational Product" stamp outside viewport
    By emilio.ebr671766 in forum AutoCAD General
    Replies: 4
    Last Post: 2012-07-13, 04:22 PM
  3. Unable to bring up the dialog box for "move or copy layout tabs"
    By plarson.118418 in forum AutoCAD General
    Replies: 7
    Last Post: 2007-12-19, 02:08 PM
  4. Replies: 6
    Last Post: 2006-04-27, 09:22 PM
  5. "Constrain" toggle for Move / Copy?
    By m_cahoon14336 in forum Revit Architecture - General
    Replies: 3
    Last Post: 2004-02-24, 02:43 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •