Author Topic: Append Registry  (Read 2638 times)

0 Members and 1 Guest are viewing this topic.

ronjonp

  • Needs a day job
  • Posts: 7529
Append Registry
« on: April 07, 2004, 10:39:11 AM »
Code: [Select]
[HKEY_CURRENT_USER\Software\Autodesk\AutoCAD\R15.0\ACAD-1:409\Profiles\WatermarkID\General]


"ACAD"=


The ACAD= already has search paths in it. How can I easily add a couple of paths?

Thanks,

Ron

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Append Registry
« Reply #1 on: April 07, 2004, 12:31:06 PM »
Registry changes won't take effect until you restart AutoCAD.
To make permanent changes to the registry path for future sessions of AutoCAD, retrieve the path value, add the new value to the end of the retrieved value, then put the new value in the registry.

To make changes that reflect only in the current drawing, and to make them immediate..
Change the acadprefix system variable.

to update drawing local support path in LISP

Code: [Select]

(setq acadpath (getvar "acadprefix"))
(setq acadpath (strcat acadpath ";" "new path"))
(setvar "acadprefix" acadpath)


To update the registry you should probably use the registry functions in VBA....

Code: [Select]

Function RegistryValue(ByVal RegistryKey As String, ByVal RegValue As Variant, ByVal ReadWriteDelete As Long, ByVal DataType As Long)
 Const VbRegDelete = 0
 Const VbRegRead = 1
 Const VbRegWrite = 2
 
 Dim WSHShell As IWshShell_Class
 Set WSHShell = Interaction.CreateObject("WScript.Shell")
 If ReadWriteDelete = VbRegRead Then
  GetRegistryValue = WSHShell.RegRead(RegistryKey)
 ElseIf ReadWriteDelete = VbRegWrite Then
  GetRegistryValue = WSHShell.RegWrite(RegistryKey, RegValue, DataType)
 ElseIf ReadWriteDelete = VbRegDelete Then
  GetRegistryValue = WSHShell.RegDelete(RegistryKey)
 End If
End Function


I am not sure about the data type of "DataType" I have not had the opportunity to research it.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

ronjonp

  • Needs a day job
  • Posts: 7529
Append Registry
« Reply #2 on: April 07, 2004, 12:38:02 PM »
Thanks Keith! :D

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Append Registry
« Reply #3 on: April 07, 2004, 12:43:46 PM »
I edited the post, so you might want to reload it
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

danny

  • Guest
Re: Append Registry
« Reply #4 on: February 02, 2006, 04:02:34 AM »
kieth,
if I'm using this lsp
Code: [Select]
(defun c:AHLCTBD ()
(setq prefs(vla-get-preferences (vlax-get-acad-object))
      filePrefs(vla-get-files prefs))
(vla-put-printerstylesheetpath filePrefs "M:\\_Cad Support\\AHL_CTB")
(vla-refreshplotdeviceinfo
  (vla-get-activelayout
   (vla-get-activedocument
     (vlax-get-acad-document))))
(alert "Notice:\nYou are now using AHL standard CTB's")
(princ)
)
What could I add to it so that the current drawing will read it.  Update the registry in current drawing?
 :-)