![]() |
#1
|
||||
|
||||
![]()
Looking for a piece code that imports an object file.
this works but puts it where it originates: Code:
Sub importgrommet() ActiveLayer.Import "C:\@_Drop\pins.cdr" End Sub Im looking to have it act like when you IMPORT and object. The object is with the mouse and you get the choice where to place it. You click and it drops in place. Not where it originally was made from. Then i would assign a shortcut for it when needed. Working with X4 Thanks All ![]() |
#2
|
|||
|
|||
![]()
try this
Code:
Sub importgrommet() On Error GoTo myerr ActiveDocument.ReferencePoint = cdrCenter Dim x As Double, y As Double Dim Shift As Long b = False b = ActiveDocument.GetUserClick(x, y, Shift, 10, False, cdrCursorWinCross) Optimization = True ActiveDocument.BeginCommandGroup "import" ActiveLayer.Import "C:\@_Drop\pins.cdr" ActiveShape.SetPosition x, y myerr: ActiveDocument.EndCommandGroup Optimization = False ActiveWindow.Refresh End Sub |
#3
|
||||
|
||||
![]()
Seem to get a compile error. I found another post a while back...
Importing to "mouse click position" I dont know what happens as I get errors. Seems like what im after. But hopefully your code will do it Quote:
Last edited by dungbtl; 02-03-2013 at 06:25. |
#4
|
|||
|
|||
![]() Code:
Sub importgrommet() On Error GoTo myerr ActiveDocument.ReferencePoint = cdrCenter Dim x As Double, y As Double, Shift As Long, b As Boolean b = False b = ActiveDocument.GetUserClick(x, y, Shift, 10, False, cdrCursorWinCross) Optimization = True ActiveDocument.BeginCommandGroup "import" ActiveLayer.Import "C:\@_Drop\pins.cdr" ActiveShape.SetPosition x, y myerr: ActiveDocument.EndCommandGroup Optimization = False ActiveWindow.Refresh End Sub |
#5
|
||||
|
||||
![]() PERFECT! Made me day ...Donuts and coffee down in the VIP room Tell em Dungbtl sent ya ![]() |
#6
|
|||
|
|||
![]() Quote:
Code:
Sub TestInteractiveImport() ActiveDocument.InteractiveImport "C:\@_Drop\pins.cdr" End Sub Last edited by SteveDude; 13-03-2013 at 14:52. |
#7
|
||||
|
||||
![]()
Thanks Steve...
Im sure it works great for X6 im in X4 & 5 any chance for a cleaner code for that? ![]() |
![]() |
Tags |
import, mouse, mouse click, object, user click |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Export & Import Text Strings in .CDR file | Shail | CorelDRAW CS | 6 | 29-03-2012 03:52 |
Import text file to create shapes | jess916 | Macros/Add-ons | 3 | 12-08-2008 20:21 |
How to import values from a file, replace text,save file for each value with new name | amaart | CorelDRAW/Corel DESIGNER VBA | 1 | 28-09-2007 12:41 |
Import SVG File to Separate Pages on Document Load | Jadus | CorelDRAW/Corel DESIGNER VBA | 5 | 30-06-2005 12:56 |
Import and ungroup PDF file | medo321 | CorelDRAW/Corel DESIGNER VBA | 1 | 24-03-2004 09:04 |