Saturday, November 21, 2009
Home   |   Search   |   About AUGI   |   My AUGI   |   Join Now

Go Back   AUGI Forums > AUGI Technical (English) > Programming > AutoLISP
 Welcome, Guest. 

Login

Join Now FAQ Members List Calendar Search Today's Posts Mark Forums Read

AutoLISP AutoLISP or Visual LISP, learn both here!

Reply
 
Thread Tools Display Modes
Old 2004-06-17, 04:10 PM   #1
pcs
Member
 
Join Date: 2000-11
Posts: 21
pcs is starting their journey
Default Creating .ink shortcuts

Is there a way to create a .ink shortcut with lisp? I am copying network files to a hard drive, and would like to create a shortcut to the network directory programmatically, so it would be easy to save back to the network.
pcs is offline   Reply With Quote
Old 2004-06-17, 05:21 PM   #2
stig.madsen
100 Club
 
Join Date: 2000-12
Posts: 126
stig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightly
Default

Thought I could find one in McNeels DosLib library but no luck. Maybe someone here knows the answer to that.

Otherwise, you can utilize the Shell scripting object. The following function creates a shortcut based on these arguments:

target: path of file to make a shortcut to
fname: filebase name of shortcut file (without extension)
path: where to put the shortcut


Code:
(defun myShortcut (target fname path / shellObj shortcut)
  (cond ((setq shellObj (vlax-create-object "WScript.Shell"))
         (setq shortcut (vlax-invoke-method
                          shellObj
                          'CreateShortcut
                          (strcat path "\\" fname ".lnk")
                        )
         )
         (vlax-put-property shortcut 'TargetPath target)
         (vlax-invoke-method shortcut 'Save)
         (vlax-release-object shortcut)
         (vlax-release-object shellObj)
        )
  )
)
Of course, you'd probably want some user interface to go with it but it should be basic stuff.

Last edited by stig.madsen : 2004-06-17 at 06:14 PM.
stig.madsen is offline   Reply With Quote
Old 2004-06-17, 07:30 PM   #3
pcs
Member
 
Join Date: 2000-11
Posts: 21
pcs is starting their journey
Default RE: Creating .ink shortcuts

Awesome Stig!
Thanks for all your help.
pcs is offline   Reply With Quote
Reply


Go Back   AUGI Forums > AUGI Technical (English) > Programming > AutoLISP

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Project Shortcuts Scott Davis Revit Architecture - Tips & Tricks 12 2004-03-10 11:37 PM
Options Bar: Shortcuts, Floating or Command line Chad Smith Revit Architecture "Original" Wish List (Archived) 14 2003-11-06 12:35 AM
Creating Families Revitlution Revit Architecture - Families 2 2003-10-10 11:59 PM
Simplified Line Keyboard Shortcuts Scott Hopkins Revit Architecture - Tips & Tricks 0 2003-07-24 08:05 PM
Keyboard Shortcuts gregcashen Revit Architecture - Tips & Tricks 14 2003-07-12 01:57 AM


All times are GMT +1. The time now is 04:22 PM.