Author Topic: Rotating attribute problem  (Read 2429 times)

0 Members and 1 Guest are viewing this topic.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Rotating attribute problem
« on: March 12, 2008, 09:26:23 AM »
I have an issue I am trying to resolve. I have a user who has just migrated from A2k4 to A2k8. In 2004, there exists no problem, however, in 2008, using VBA to programmatically insert certain blocks with attributes causes the attributes to be rotated to 0 degrees.

If the block is inserted manually, everything is cool ... is there something different in VBA in 2008 that causes this or is there a setting somewhere that I am not aware of? .. ok that last part is loaded .. there are lots of settings that I am not aware of .. :)
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

hendie

  • Guest
Re: Rotating attribute problem
« Reply #1 on: March 12, 2008, 09:47:56 AM »

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: Rotating attribute problem
« Reply #2 on: March 12, 2008, 09:57:53 AM »
Ah .. cool ... perhaps we should remove this thread ... or perhaps I'll just watch the other thread.

Thanks
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4076
Re: Rotating attribute problem
« Reply #3 on: March 12, 2008, 10:05:54 AM »
Keith, are you just inserting a block just like we always have or did you code it differently this time?  I am interseted in seeing your code if poss
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: Rotating attribute problem
« Reply #4 on: March 12, 2008, 10:59:31 AM »
Same as always ...

I can't divulge the code as a whole, but I can offer this tidbit just to see what is going on ..

Code: [Select]
If Activedocument.ActiveSpace = AcModelSpace Then
    Set blk = Activedocument.ModelSpace.InsertBlock(InsPt, BlkName, Xscl, Yscl, Zscl, 0)
Else
    Set blk = Activedocument.PaperSpace.InsertBlock(InsPt, BlkName, Xscl, Yscl, Zscl, 0)
End If

MyAtts = blk.GetAttributes
For X = 0 to Ubound(MyAtts)
   strTag = MyAtts(X).TagString
   Select Case strTag
   Case "IDNO"
      MyAtts(X).TextString = "Some random text previously defined"
' lots more case statements here
   End Select
Next X

I did just notice that in certain circumstances, the block is programmatically rotated after the attributes are filled in like such ..

Code: [Select]
blk.Rotation = RotAng

but programmatically, it should not cause the attributes to be changed from the original rotation settings in the original block.

I think I'll try making sure the blocks are at 0 deg only when inserting them and see if it makes a difference.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4076
Re: Rotating attribute problem
« Reply #5 on: March 12, 2008, 01:45:44 PM »
That is weird for sure.  I think I will try and recreate the problem here
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: Rotating attribute problem
« Reply #6 on: March 20, 2008, 09:18:36 PM »
This issue has been resolved and I will attribute it to a bug in AutoCAD 2008. Please see this thread for the resolution.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie