Recent Posts

Pages: [1] 2 3 ... 10
1
Oh, I have copious menu modifications, function definitions and reactors that load at startup. I am certain that one or more is the root cause of the issue.

That is of less concern really than being constantly prompted to redefine blocks. I close a drawing once or twice while working on it but I insert hundreds of blocks, sometimes thousands.
2
Hello, I am looking for help to modify lisp code that places text at various insertion points, I have been searching for some code that will help me to scale the base points based on the current annotation value.
the routine is working perfect at 1:5000 but when inserting at any other scale is not what is needed because the base points are static in the code,  asking for help to scale the base point coordinates from the insertion points from the cannoscale.

specifically I have one insertion point to start and six base points for the text insertion.

lisp is attached.
function is "BCLabelUnitQuarters"

thank you

Trevor
3
I stumbled on this from Jeff M which is supposed to change a profile view style. However, I can not seem to get it to work.

Anyone have any ideas possibly?

Code: [Select]
(vl-load-com)

(defun c:test (/ ent)
(setq Ent (car (entsel "\nSelect Profile View: ")))
  (and (setq *acad* (vlax-get-acad-object))
       (setq C3D (strcat "HKEY_LOCAL_MACHINE\\" (if vlax-user-product-key (vlax-user-product-key) (vlax-product-key) ) )
      C3D (vl-registry-read C3D "Release")
      C3D (substr C3D 1 (vl-string-search "." C3D (+ (vl-string-search "." C3D) 1) ) )
      C3D (vla-getinterfaceobject *acad* (strcat "AeccXUiLand.AeccApplication." C3D) )      )
       (setq C3Ddoc (vla-get-activedocument C3D))
  )
(setq settings (vlax-get c3ddoc 'settings))
(setq pvcmdsettings (vlax-get settings 'profileviewcommandssettings))
(setq createpvsettings (vlax-get pvcmdsettings 'createprofileviewsettings))
(setq stylesettings (vlax-get createpvsettings 'stylesettings))
(vlax-put (vlax-get stylesettings 'style) 'value "Full Grid");;The stylename must exist!!!

(princ))

https://forums.autodesk.com/t5/civil-3d-customization/modify-default-civil-3d-styles-with-lisp/td-p/7173700


Thanks for any help!
4
I need (getvar "memory-LispStacks"), for compare two solution/s on sameResult.
I have two defun/s with,both same result.
The features is how to compare these both defun/s,, who is better defun1 Vs defun2.
If I type (mem) then I got this (screen$isInsideTextScr  "PgSz  Used  Free  FMCL  Segs  Type")
Code: [Select]
*PgSz  Used  Free  FMCL  Segs  Type
 512    79    48    48     1  lisp stacks
 256  3706   423   142    16  bytecode area
4096   320    10    10    22  CONS memory
  32   769  1213  1089     1  ::new
4096   168    12    10    12  DM Str
4096   222     4     4    15  DMxx memory
 128     4   507   507     1  bstack body
/PgSz  Used  Free  FMCL  Segs  Type
Segment size: 65536, total used: 68, free: 0
:idea:
How to redirect this screen$isInsideTextScr. to var_isList?
(setq screen$List (list " 512    79    48    48     1  lisp stacks\n"  " 256  3706   423   142    16  bytecode area\n" "4096   320    10    10    22  CONS memory"))


5
You can freeze the current layer via DBX  :-)

Good point!!
This remark is "freezing" my brain!  :wink:
Thanks again.
6
AutoLISP (Vanilla / Visual) / Re: Adding a personal ToolPalette...
« Last post by framednlv on May 05, 2021, 05:05:07 PM »
Code: [Select]
(defun RE_MYTP (/ pattern RemoveTP$ BothTP CurrentTP PersonalTP)
(defun RemoveMYTP ()
(setq pattern (strcat (getenv "UserProfile") "\\Documents\\My Autocad Support\\"(getvar "loginname")"_Palettes;"))
(setq RemoveTP$ (vl-string-subst "" pattern CurrentTP ))
(setvar "*_TOOLPALETTEPATH" RemoveTP$)
)


(defun AddMYTP ()
(if (null (vl-file-directory-p (strcat (getenv "UserProfile") "\\Documents\\My Autocad Support\\"(getvar "loginname")"_Palettes")))
(vl-mkdir (strcat (getenv "UserProfile") "\\Documents\\My Autocad Support\\"(getvar "loginname")"_Palettes")))
(setvar "*_TOOLPALETTEPATH" (strcat (getenv "UserProfile") "\\Documents\\My Autocad Support\\"(getvar "loginname")"_Palettes"))
(command "DELAY" 500)
(setq BothTP (strcat (getenv "UserProfile") "\\Documents\\My Autocad Support\\"(getvar "loginname")"_Palettes;" CurrentTP))
(setvar "*_TOOLPALETTEPATH" BothTP)
)

(setq CurrentTP (getvar "*_TOOLPALETTEPATH"))
(setq PersonalTP (strcat (getenv "UserProfile") "\\Documents\\My Autocad Support\\"(getvar "loginname")"_Palettes*"))
(if (wcmatch CurrentTP PersonalTP)
(RemoveMYTP);;Go to removeTP
(AddMYTP);;Go to AddTP
);end if
);end defun
7
AutoLISP (Vanilla / Visual) / Re: Modifying layers in multiple files at once
« Last post by ronjonp on May 05, 2021, 04:20:49 PM »
You can freeze the current layer via DBX  :-)
8
AutoLISP (Vanilla / Visual) / Re: list with interface names
« Last post by Grrr1337 on May 05, 2021, 09:28:25 AM »
thank you for replay BIGAL, Iīm wondering if you have a better understanding than I, how calls different interface. I test little with follow but I canīt see a logic
Code: [Select]
      (vla-getinterfaceobject (vlax-get-acad-object) (strcat "AutoCAD.AcCmColor." (substr (getvar "ACADVER") 1 2))) ; Color
      (vla-getinterfaceobject (vlax-get-acad-object) (strcat "AutoCAD.AcadLayerStateManager." (substr (getvar "ACADVER") 1 2)))
      (vla-getinterfaceobject (vlax-get-acad-object) "AeccXUiPipe.AeccPipeApplication.12.0")
      (vla-getinterfaceobject (vlax-get-acad-object) "AeccXUiLand.AeccApplication.12.0") ;Civil3d database
      (vla-getinterfaceobject (vlax-get-acad-object) (strcat "ObjectDBX.AxDbDocument." (itoa (atoi (getvar "ACADVER")))))
      (vla-getinterfaceobject (vlax-get-acad-object) "autocad.securityparams.22")
      (vla-getinterfaceobject (vlax-get-acad-object) "MSXML.DOMDocument")
      (vla-getinterfaceobject (vlax-get-acad-object) "AeccXLand.AeccTinCreationData.12.0")
      (vla-getinterFaceObject (vlax-get-acad-object) "AeccXUiPipe.AeccPipeApplication.12.0")

Hi, check this thread and the reply of our valued Michael for his sub _FindProjIDs .
9
AutoLISP (Vanilla / Visual) / Re: Modifying layers in multiple files at once
« Last post by vicoco on May 05, 2021, 05:21:25 AM »
Welcome to TheSwamp :) Try something like this for your layers:
Code - Auto/Visual Lisp: [Select]
  1. (foreach lyr '("LayerName1" "LayerName2")
  2.   (if (not (vl-catch-all-error-p (setq l (vl-catch-all-apply 'vla-item (list layertable lyr)))))
  3.     (vl-catch-all-apply 'vla-put-freeze (list l :vlax-true))
  4.   )
  5. )
I don't think you can set a current layer via odbx, but could be wrong.

I don't think you can set a current layer via odbx, but could be wrong.

Correct - the activelayer property is not available for an ObjectDBX document, and neither is the setvariable method unfortunately.

@vicoco, this:
Code - Auto/Visual Lisp: [Select]
  1. (setq LayerTable (vla-get-layers acd))

Should be:
Code - Auto/Visual Lisp: [Select]
  1. (setq LayerTable (vla-get-layers doc))

So as to obtain the Layers Collection for the ObjectDBX document as opposed to the Active Document.

Thank you very much to both!!

Because AutoCAD does not allow freezing the current layer, and it's possible that some dwg has one of the layers to freeze as current, I have decided to modify the code, turning the layers off instead of freezing:

Code - Auto/Visual Lisp: [Select]
  1. (foreach lyr '("LayerName1" "LayerName2")
  2.   (if (not (vl-catch-all-error-p (setq l (vl-catch-all-apply 'vla-item (list layertable lyr)))))
  3.     (vl-catch-all-apply 'vla-put-layeron (list l :vlax-false))
  4.   )
  5. )

I am a very beginner in LISP and VL, and I am still learning and understanding many new things every day.
10
AutoLISP (Vanilla / Visual) / Re: list with interface names
« Last post by cadplayer on May 05, 2021, 12:00:37 AM »
Civil 2018 -> 12.0
AeccXUiPipe.AeccPipeApplication.12.0
I would like understand where this string "AeccXUiPipe.AeccPipeApplication" defined to call "Pipe-interface"
It haves many other interfaces in both Autocad and Civil API, I would like more understand to work with them in ActiveX/COM
Pages: [1] 2 3 ... 10