Author Topic: CommandLine Class (Tonys)  (Read 14797 times)

0 Members and 1 Guest are viewing this topic.

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
Re: CommandLine Class (Tonys)
« Reply #30 on: August 07, 2010, 04:58:10 PM »
Here I am, 3 years later, just now needing to use this Class of Tony's. First I'd like to say thanks to Tony for making this code available. It works fine, except for the full context that I would like for it to....

Background, Civil3D makes renumbering Curve/Line/Spiral Tag labels a slow and cumbersome task, especially if one wants to renumber matching items to the same number. For instance, my line labels L1, L5, L6, and L12 all have the same bearing & length so I want to renumber all of them to L1. This cannot currently be done using the C3D API's, at least not that I've yet discovered, so I'm using the "EditTagLabels" C3D command and Tony's code to call it.

2 issues I've run into, that I'm not sure how to fix. First is that the edited label's display does not update until after my command ends, which makes it difficult to keep track of which labels have already been changed.

Second, and more of a problem, is that the "EditTagLabels" prompts changes when the new number duplicates an existing number. Which means I need to provide an extra response for the command when a duplicate is found (which will be most of the time, but I still need to account for both scenarios). Is there a way to accommodate for this? These are the 2 lines that I somehow need to be just 1 that works in either case:
Code: [Select]
CaddZone.ApplicationServices.CommandLine.Command("EditTagNumbers", entRes.PickedPoint, "");
CaddZone.ApplicationServices.CommandLine.Command("EditTagNumbers", entRes.PickedPoint, "c", "");
The biggest hurdle is that I have no way of determining before the command is run which numbers are already in use.

Any hints on either one, or both, of these issues would be greatly appreciated.

Jeff

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
Re: CommandLine Class (Tonys)
« Reply #31 on: August 07, 2010, 05:18:57 PM »
As usual, as soon as I post a question I manage to solve at least a portion of it within minutes....the first problem of the labels not updating was solved by changing where I start/commit the transaction. And now that I can see the labels change, I see that the code still works whether the number exists or not, it just is throwing up a warning that gets bypassed.....

So, it all appears to be working fine now.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: CommandLine Class (Tonys)
« Reply #32 on: August 07, 2010, 07:39:03 PM »

That happens to me a lot
.. it's the reason I usually sleep on problems before posting .. I think resolving has something to do with verbalising the issue.

I noticed this from Tony last night ,,, looks interesting
http://forums.autodesk.com/t5/NET/New-Sample-Application-Defined-System-Variables/m-p/2738909#U2738909
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
Re: CommandLine Class (Tonys)
« Reply #33 on: August 07, 2010, 08:09:10 PM »

I noticed this from Tony last night ,,, looks interesting
http://forums.autodesk.com/t5/NET/New-Sample-Application-Defined-System-Variables/m-p/2738909#U2738909

Yes it does, thanks for making note of it here.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: CommandLine Class (Tonys)
« Reply #34 on: August 11, 2010, 06:56:27 AM »

You're welcome Jeff :)

another one of Tony's which I'll reference since he hasn't visited here much recently.

ExtensionApplicationInfo.zip
in this thread :
http://forums.autodesk.com/t5/NET/Netload-help/m-p/2736243/highlight/true#M20202
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Glenn R

  • Guest
Re: CommandLine Class (Tonys)
« Reply #35 on: August 11, 2010, 12:23:56 PM »

That happens to me a lot
.. it's the reason I usually sleep on problems before posting .. I think resolving has something to do with verbalising the issue.

I noticed this from Tony last night ,,, looks interesting
http://forums.autodesk.com/t5/NET/New-Sample-Application-Defined-System-Variables/m-p/2738909#U2738909


Goes bang. 'Autodesk.AutoCAD.Runtime.Variable' does not contain a definition for 'StorageType' is just one of the compile errors.
Anyone else?

Win 7 Pro x64
AutoCAD 2010 x64
VC# 2008 Express
Linked against 2010\inc-x64 SDK

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
Re: CommandLine Class (Tonys)
« Reply #36 on: August 11, 2010, 02:13:03 PM »

Goes bang. 'Autodesk.AutoCAD.Runtime.Variable' does not contain a definition for 'StorageType' is just one of the compile errors.
Anyone else?

Win 7 Pro x64
AutoCAD 2010 x64
VC# 2008 Express
Linked against 2010\inc-x64 SDK
It builds fine for 2011, but I get the same results as you with 2010.

dgorsman

  • Water Moccasin
  • Posts: 2437
Re: CommandLine Class (Tonys)
« Reply #37 on: August 11, 2010, 02:20:15 PM »
If I remember the API webcast correctly, they were in place but not enabled for the 2010 release.
If you are going to fly by the seat of your pants, expect friction burns.

try {GreatPower;}
   catch (notResponsible)
      {NextTime(PlanAhead);}
   finally
      {MasterBasics;}