AutoCAD Land Desktop (Read Only)
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Changing alignment description - Bug in API ?

5 REPLIES 5
Reply
Message 1 of 6
Anonymous
197 Views, 5 Replies

Changing alignment description - Bug in API ?

Hi, We are trying to change the alignment description with VBA code. A simplistic example is: Sub Test () Dim oAlign as AeccAligment Set oAlign = AeccApplication.ActiveProject.Alignments(0) oAlign.Description = "Test" End Sub The code stops at the line oAlign.Description = "Test" with a message that the Description is read only. The help files say it is read-write. Has anyone experienced this and/or know of a programmable work around. -- Regards Laurie Comerford www.cadapps.com.au
5 REPLIES 5
Message 2 of 6
Anonymous
in reply to: Anonymous

Hi Laurie, It seems you can only change the description of the Current alignment. Unfortunately it is not possible to simply set an alignment to be current and then change it's description, however the code below works. Modify code to: Sub Test Dim x as AeccAligment Dim y as AeccAlignments Dim oAlign as AeccAligment Set y = AeccApplication.Active.Project.Alignments Set oAlign = y(0) y.CurrentAlignment = oAlign.Name Set x = y.Item(oAlign.Name) x.Description = "Test" End Sub Thanks Laurie - you're a hero :-) -- Regards Laurie Comerford www.cadapps.com.au "Laurie Comerford" wrote in message news:4164e849_1@newsprd01... > Hi, > > We are trying to change the alignment description with VBA code. > > A simplistic example is: > > Sub Test () > > Dim oAlign as AeccAligment > Set oAlign = AeccApplication.ActiveProject.Alignments(0) > oAlign.Description = "Test" > End Sub > > The code stops at the line oAlign.Description = "Test" > with a message that the Description is read only. > > The help files say it is read-write. > > Has anyone experienced this and/or know of a programmable work around. > > -- > > Regards > > > Laurie Comerford > www.cadapps.com.au > >
Message 3 of 6
Anonymous
in reply to: Anonymous

Hi, Just a word to clarify that the reason thi is done in this way is because we have to use set current alignment >>method<< first, then grab that alignment and set it's description >>property<<. regs Rad Lazic "Laurie Comerford" wrote in message news:41661769_2@newsprd01... > Hi Laurie, > > It seems you can only change the description of the Current alignment. > Unfortunately it is not possible to simply set an alignment to be current > and then change it's description, however the code below works. > > Modify code to: > > Sub Test > Dim x as AeccAligment > Dim y as AeccAlignments > Dim oAlign as AeccAligment > Set y = AeccApplication.Active.Project.Alignments > Set oAlign = y(0) > y.CurrentAlignment = oAlign.Name > Set x = y.Item(oAlign.Name) > x.Description = "Test" > End Sub > > Thanks Laurie - you're a hero :-) > > > -- > > Regards > > > Laurie Comerford > www.cadapps.com.au > "Laurie Comerford" wrote in > message news:4164e849_1@newsprd01... > > Hi, > > > > We are trying to change the alignment description with VBA code. > > > > A simplistic example is: > > > > Sub Test () > > > > Dim oAlign as AeccAligment > > Set oAlign = AeccApplication.ActiveProject.Alignments(0) > > oAlign.Description = "Test" > > End Sub > > > > The code stops at the line oAlign.Description = "Test" > > with a message that the Description is read only. > > > > The help files say it is read-write. > > > > Has anyone experienced this and/or know of a programmable work around. > > > > -- > > > > Regards > > > > > > Laurie Comerford > > www.cadapps.com.au > > > > > >
Message 4 of 6
Anonymous
in reply to: Anonymous

It's nice to share and all, but um, don't you two share an office? See you in Vegas, Rad? -- James Wedding, P.E. IT Manager Jones & Boyd, Inc. Dallas, TX XP/2 on P4-3.4/1G LDT2005+C3D http://au.autodesk.com Sign up now for AU2004!
Message 5 of 6
Anonymous
in reply to: Anonymous

Hi James, Hey, you're embarassing us. This was a real partnership event. Rad asked Peter Funk who provided the current directory clue, I asked here. Rad typed the above code while I added suggestions. The result is Rad's very elegant program for editing alignment descriptions. This program will be packaged with Advanced Road Design. -- Regards, Laurie Comerford www.cadapps.com.au "James Wedding" wrote in message news:416bdecf$1_1@newsprd01... > It's nice to share and all, but um, don't you two share an office? > > See you in Vegas, Rad? > > -- > James Wedding, P.E. > IT Manager > Jones & Boyd, Inc. > Dallas, TX > XP/2 on P4-3.4/1G > LDT2005+C3D > http://au.autodesk.com > Sign up now for AU2004! >
Message 6 of 6
Anonymous
in reply to: Anonymous

And I was buried, so I asked Rad and Laurie to post the solution for all you'all to see. Cheers, Peter Funk Autodesk, Inc.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report