TheSwamp
Code Red => Visual DCL Programming => AutoLISP (Vanilla / Visual) => OpenDCL => Topic started by: Langbolt on May 14, 2021, 08:24:32 AM
-
Not sure why this is happening.....This routine works fine in AutoCAD2013.....but when we upgraded to 2020 we get an Unhandled Exception.
Brief description of program: It Pull/Pushes data from the header block which are stored in the Drawing Props (type DWGPROPS to view)
When we run the program it pulls the data correctly and displays them correctly in the form in the text boxes.
Selecting the cancel button and it closes the form correctly (I did have to change the syntax of the form close from:
(dcl_Form_Close STEPHEADER_HEADER 1) to (dcl-Form-Close STEPHEADER/HEADER 1) .....so it would close the form.
But, the same code doesn't seem to work in the UPDATE button.
Any help would be greatly appreciated
:)
Thanks
John
-
Here's a copy of the Drawing Template......;)
REVISED - Correct & updated Template
-
Sorry, I don't know the answer to your problem but I just wanted to welcome you to TheSwamp, Langbolt.
-
Thanks John.....Glad to be here :-)
-
Maybe the wrong template was attached?
The tag "SHAPE" does not occur in the DWT. Instead I find "STP_SHAPE".
-
Roy_043
In the STEP HEADER block you will find the SHAPE attribute.....type "BEDIT" and choose the STEP HEADER block....then select the attribute beside Shape: (in the lower left corner)
Tag: SHAPE
Prompt: Step Shape
Value: -
And if you type "DWGPROPS" at the command line it will display STEP.SHAPE in the list.
Did you do a search in LISP to find the TAG's in the Drawing ?
Thanks for your help
John
-
(mapcar 'vla-get-tagstring (vlax-invoke (vlax-ename->vla-object (car (entsel))) 'getattributes))
=>
("STP_SHAPE" "STP_SIZE" "STP_DESCRIPTION" "STP_TYPE" "STP_PANEL" "STP_PERIMETER" "DRAWNBY" "DRAWNDATE" "STP_REVISION" "DWG")
-
Hi Roy,
That is weird!
When I use your Vlisp code and select the "step header" block this is what I get.
Command: (mapcar 'vla-get-tagstring (vlax-invoke (vlax-ename->vla-object (car (entsel))) 'getattributes))
Select object: ("CUSTOMER" "TAG" "WORKORDER" "SHAPE" "DESCRIPTION" "PTYPE" "DESIGNER" "STYPE" "PHEIGHT" "DRAWNDATE" "REVISION#" "DRAWING")
I found there was an extra block....so I removed it (STEP HEADER B) - it doesn't need to be there.
Also, I think you're right....I think that was the wrong template as I checked the Template File Location in Autocad and it was pointing to the wrong folder.....sorry for the confusion.
Attached is the revised template.
Thank you for your assistance
:)
John
-
There is an issue with using command calls in an ODCL event handler.
See: https://opendcl.com/forum/index.php?topic=2190.0
Try using vla-regen instead or move the command call to the main function as per the advice in the link.
-
Winner Winner! Chicken Dinner!!!!
Thanks Roy!
I replaced:
with:
Works like a dream!!!
:yay!: :yay!: :yay!: