Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Home
Help
Login
Register
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
Topic:
How to Assign Value in Custom Tab in Dwgprops
« previous
next »
Print
Pages: [
1
] |
Go Down
Author
Topic: How to Assign Value in Custom Tab in Dwgprops (Read 1417 times)
0 Members and 1 Guest are viewing this topic.
MeasureUp
Bull Frog
Posts: 465
How to Assign Value in Custom Tab in Dwgprops
«
on:
November 02, 2023, 05:13:43 AM »
Can anyone please help?
Here is an example.
Supposed there are tens custom property names in the "Custom" tab in "DWGPROPS" dialogue.
If
WeekDay_02
is found in the "Name" column, then
Monday
is to be added to it's value cell.
Thanks in advance.
Logged
Lee Mac
Seagull
Posts: 12940
London, England
WWW
Re: How to Assign Value in Custom Tab in Dwgprops
«
Reply #1 on:
November 02, 2023, 05:40:25 AM »
The key is the ActiveX
SummaryInfo
object, specifically the
SetCustomByKey
method.
Logged
Lee Mac Programming
•
Twitter
•
Exchange App Store
dexus
Bull Frog
Posts: 232
Re: How to Assign Value in Custom Tab in Dwgprops
«
Reply #2 on:
November 02, 2023, 06:01:14 AM »
You can use the code
here
and call it with: (getCustomDwgProp "name")
Logged
MeasureUp
Bull Frog
Posts: 465
Re: How to Assign Value in Custom Tab in Dwgprops
«
Reply #3 on:
November 03, 2023, 05:18:35 AM »
Thanks Lee. your reply is always informative. I will ask again if having more questions.
And thanks to dexus. Your code is a helpful example and I will learn from it.
Both helps are much appreciated.
Logged
MeasureUp
Bull Frog
Posts: 465
Re: How to Assign Value in Custom Tab in Dwgprops
«
Reply #4 on:
November 03, 2023, 06:05:45 AM »
Hi dexus,
How do I apply "if" statement with (getCustomDwgProp "name") function?
I need to search if the name of
WeekDay_02
is found then add
Monday
to the value.
Thanks.
Logged
Lee Mac
Seagull
Posts: 12940
London, England
WWW
Re: How to Assign Value in Custom Tab in Dwgprops
«
Reply #5 on:
November 03, 2023, 09:52:47 AM »
Here's a very basic example -
Code - Auto/Visual Lisp:
[Select]
(
defun
foo
(
doc key str
/
sum
)
(
setq
sum
(
vla
-
get
-
summaryinfo doc
)
)
(
if
(
not
(
vl-catch-all-error-p
(
vl
-
catch
-
all
-
apply
'vla
-
getcustombykey
(
list
sum key 'out
)
)
)
)
(
progn
(
vla
-
setcustombykey sum key str
)
t
)
)
)
Code - Auto/Visual Lisp:
[Select]
(
foo
(
vla-get-activedocument
(
vlax-get-acad-object
)
)
"WeekDay_02"
"Monday"
)
Logged
Lee Mac Programming
•
Twitter
•
Exchange App Store
MeasureUp
Bull Frog
Posts: 465
Re: How to Assign Value in Custom Tab in Dwgprops
«
Reply #6 on:
November 04, 2023, 01:06:46 AM »
Thanks again, Lee.
«
Last Edit: November 04, 2023, 01:13:31 AM by MeasureUp
»
Logged
Print
Pages: [
1
] |
Go Up
« previous
next »
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
Topic:
How to Assign Value in Custom Tab in Dwgprops