- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello, Im having trouble with this program in trying to modify it to have an attribute prompt included. The program as it sits works fine to insert the block and set the Visibility state. I wanted to change it so that the user is prompted for the attribute value upon insertion, the same way it would if you were just manually inserting the block. I tried doing this with the -INSERT function (removing the last quotes), and it did insert the block with the attribute prompt but the Visibility part failed.
(vl-cmdf "-INSERT" "UtilityLocator_DYN" PNT "" "" "")
I also tried adding in a setpropertyvalue function after the Visibility state line, and it worked for visibility but the attribute part didnt work. Im sure I have something wrong after the attribute name here, I tried a few things this was just the last attempt.
(setpropertyvalue (entlast) "DIST" (command pause))
Ive attached the block below. Ive had problems with this before and never really understood a good way to make it work. Thanks in advance for any help.
The main program:
(DEFUN C:UTIL () (UTIL NIL))
(DEFUN UTIL (TYP)
(GV)
(0V)
(SETVAR 'CLAYER "PLUMBING-EQUIP")
(IF (NULL TYP)
(PROGN (INITGET "Equipment AirConditioner ElectricBox GasStub HoseBib")
(SETQ TYP (COND ((GETKWORD
"\nSpecify Marker [Equipment/AirConditioner/ElectricBox/GasStub/HoseBib] <ElectricBox>: "
)
)
("ElectricBox")
)
)
)
)
(SETQ PNT (GETPOINT "\n\t\t =>> Pick a Location <<= "))
(if PNT
(progn
(vl-cmdf "-INSERT" "UtilityLocator_DYN" PNT "" "" "" "")
(chgdynprop (entlast) "Visibility" TYP)
)
)
(SV)
(PRINC)
)
Solved! Go to Solution.