CAD Forum - Database of tips, tricks and utilities for AutoCAD, Inventor and other Autodesk products [www.cadforum.cz]
CZ | EN | DE
Login or
registration
  Visitors: 8041
RSS channel - CAD tips RSS tips
RSS discussions

Discussion Discussion forum

 

HelpCAD discussion

 
CAD Forum - Homepage CAD discussion forum - ask any CAD-related questions here, share your CAD knowledge on AutoCAD, Inventor, Revit and other Autodesk software with your peers from all over the world. To start a new topic, choose an appropriate forum.

Please abide by the rules of this forum.

How to post questions: register or login, go to the specific forum and click the NEW TOPIC button.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Topic ClosedScript to update attributes within a block

 Post Reply Post Reply
Author
dvdtlf View Drop Down
Newbie
Newbie


Joined: 01.Dec.2015
Location: United Kingdom
Using: AutoCAD2008, AutoCAD 2016 Electrical
Status: Offline
Points: 7
Direct Link To This Post Topic: Script to update attributes within a block
    Posted: 01.Dec.2015 at 15:02
Hi all,

New to the forum and this is my first post which I hope someone can assist me with.

I have started using AutoCAD Electrical 2016 (just moved up from AutoCAD 2008!)

I use an access database to store information about the drawings (DWG No, Customer, Revision etc) and also to aid in configuration management.

As part of this database there are various VB scripts ran, these gather the information and create an AutoCAD script which in simple terms - opens an A3 drawing template, inserts a drawing info box (a block which has attributes) and populates it with the information from access. 

This worked a treat in 2008 but I am having issues with 2016.

I cannot workout how to get the script to write to the attributes - when the script is read it sees the text as a command rather than a description that needs to be put in the 'value' field of a tag. 

Has anyone got any ideas on how an AutoCAD 2016 script can update attributes in a block please?

If I need to supply more info please let me know and I will do my best.

Thank you
David

Back to Top
John Connor View Drop Down
Senior Member
Senior Member


Joined: 01.Feb.2011
Location: United States
Using: AutoCAD 2018
Status: Offline
Points: 7175
Direct Link To This Post Posted: 01.Dec.2015 at 15:56
Isn't all the information you used to track via the database when you were using AutoCAD 2008 now somehow tracked in the project information of AutoCAD Electrical 2016?
"Humans have a strength that cannot be measured. This is John Connor. If you are reading this, you are the resistance."

<<AutoCAD 2015>>

Back to Top
dvdtlf View Drop Down
Newbie
Newbie


Joined: 01.Dec.2015
Location: United Kingdom
Using: AutoCAD2008, AutoCAD 2016 Electrical
Status: Offline
Points: 7
Direct Link To This Post Posted: 01.Dec.2015 at 16:43
yes all the information is there (contained in the AutoCAD script generated by the access script) but unfortunately something has changed between 2008 and 2016 and the script will not populate the attributes in the drawing info box within the new drawing
 
 
Back to Top
John Connor View Drop Down
Senior Member
Senior Member


Joined: 01.Feb.2011
Location: United States
Using: AutoCAD 2018
Status: Offline
Points: 7175
Direct Link To This Post Posted: 01.Dec.2015 at 17:39
So it was AutoCAD Electrical 2008 not "vanilla" AutoCAD that you were using?
"Humans have a strength that cannot be measured. This is John Connor. If you are reading this, you are the resistance."

<<AutoCAD 2015>>

Back to Top
dvdtlf View Drop Down
Newbie
Newbie


Joined: 01.Dec.2015
Location: United Kingdom
Using: AutoCAD2008, AutoCAD 2016 Electrical
Status: Offline
Points: 7
Direct Link To This Post Posted: 02.Dec.2015 at 08:58
'Vanilla' AutoCAD2008 was the initial version I was using and I have now upgraded to AutoCAD Electrical 2016

Edited by dvdtlf - 02.Dec.2015 at 08:58
Back to Top
dvdtlf View Drop Down
Newbie
Newbie


Joined: 01.Dec.2015
Location: United Kingdom
Using: AutoCAD2008, AutoCAD 2016 Electrical
Status: Offline
Points: 7
Direct Link To This Post Posted: 02.Dec.2015 at 09:17
The below is a screen shot of the script generated by Access which AutoCAD 2008 will happily use to populate the drawing info box.
 
This script works in Electrical 2016 until it see 'Fred1' when it falls over because the text is seen as a command rather than info that needs to be moved to an attribute.
 
Hope this helps clear my query up a bit.
Back to Top
dvdtlf View Drop Down
Newbie
Newbie


Joined: 01.Dec.2015
Location: United Kingdom
Using: AutoCAD2008, AutoCAD 2016 Electrical
Status: Offline
Points: 7
Direct Link To This Post Posted: 02.Dec.2015 at 10:31
and this is what it does in 2008.
 
the important bit is in blue
 
when I insert a block in 2008 the attribute value dialogue is automatically opened - this does not happen in Elec 2016
 
my question now is how to achieve this in Elec 2016? !
Back to Top
dvdtlf View Drop Down
Newbie
Newbie


Joined: 01.Dec.2015
Location: United Kingdom
Using: AutoCAD2008, AutoCAD 2016 Electrical
Status: Offline
Points: 7
Direct Link To This Post Posted: 02.Dec.2015 at 12:25
In case anyone needs help in the future
CLIPROMPTUPDATE set to 1
ATTREQ set to 1
 
Stops dialogue boxes appearing in Elec 2016 and lets you use the command line to type in information
Back to Top

Related CAD tips:


 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0,332 seconds.