Author Topic: Convert string to list?  (Read 10688 times)

0 Members and 1 Guest are viewing this topic.

Brick_top

  • Bull Frog
  • Posts: 218
Re: Convert string to list?
« Reply #15 on: October 01, 2012, 04:45:12 AM »

You cant re-use handles
You can't re-use ObjectID's

You need a way of asserting that Table objects exist in the target drawing ; ie layers, styles, linetypes etc, etc.


Hint:
Do you know what the acronym DXF stands for ??
Do you know the commands DXFOUT, DXFIN ??

I have just a basic ideia of what handles and objectIDs are.

The table wouldn't be a problem because I want this to work in the file where the objects are created.

DXFOUT and DXFIN are used to import and export dxf files right?


What I want to to is this:

I already have a routine where I store notes of the development of a project.

Now for each note I would like to have the drawing revert or be rebuilt to the stage of when the note was created.
What I'm doing now is creating slides of how the project was when the note was created.

But I would like to somehow say that some entities belong to note n1 and some other entities belong to note n 2.

edit - forgot to answer that DXF stands for drawing interchange format


Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Convert string to list?
« Reply #16 on: October 01, 2012, 04:54:29 AM »

Sounds to me as if you could achieve your target with blocks (simply archive the drawing at each report stage)

no code, no maintenance, ...

just name your 'saveas' using the 'stage' number/name/ID
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

--> Donate to theSwamp<--

Brick_top

  • Bull Frog
  • Posts: 218
Re: Convert string to list?
« Reply #17 on: October 01, 2012, 05:01:54 AM »

Sounds to me as if you could achieve your target with blocks (simply archive the drawing at each report stage)

no code, no maintenance, ...

just name your 'saveas' using the 'stage' number/name/ID

This might be just a little quirk...

But I was trying to avoid that because some projects have lots of versions and that would use a lot more disk space.

In what I was trying to do only the new entities would be stored seperately, and some older ones would need to be deleted.

I think I might be getting into a project too big for my knowledge.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Convert string to list?
« Reply #18 on: October 01, 2012, 06:16:45 AM »

I'm not trying to scare you off  the project :)

as dgorsman noted early in the thread, knowing ALL the details is important.

I don't see why the concern about little disk space should stop the project.
It would be easier to cut and paste some entitys from a previous incarnation of the drawing that to write code to control it.

I don't understand exactly what you mean by 'stages' and notes.
In the past I have documented progress and recorded milestone events simply by archiving the drawing (ie save-As) and using a meaningful name for the document. Sometimes this happened several times a day.
It was a critical QA process when we were dealing with recording a drawing state prior to making design changes.

Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

--> Donate to theSwamp<--

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

--> Donate to theSwamp<--

pBe

  • Bull Frog
  • Posts: 377
Re: Convert string to list?
« Reply #20 on: October 01, 2012, 09:03:04 AM »
....
(entmakex (rts postedstring))

Usable: --->>> Excludes DXF 0 5 330 <<<---but you guys already know that.

Now you have made it very difficult for me to take your challenge... that function did what I wanted!

Don't worry yourself about the "challenge", just having fun is all.

I'm with Kerry on this, i'd rather save the files as DXF or DWG even, sans version and all.




Brick_top

  • Bull Frog
  • Posts: 218
Re: Convert string to list?
« Reply #21 on: October 01, 2012, 09:39:19 AM »

I'm not trying to scare you off  the project :)

as dgorsman noted early in the thread, knowing ALL the details is important.

I don't see why the concern about little disk space should stop the project.
It would be easier to cut and paste some entitys from a previous incarnation of the drawing that to write code to control it.


I think that is the most realistic easier common sense to do it.

I think I was trying to make it "prettier"

Quote
I don't understand exactly what you mean by 'stages' and notes.
In the past I have documented progress and recorded milestone events simply by archiving the drawing (ie save-As) and using a meaningful name for the document. Sometimes this happened several times a day.
It was a critical QA process when we were dealing with recording a drawing state prior to making design changes.

By stages I think I mean revisions?

I decided to add notes to the projects because there are a lot of changes to the projects and in the past I have had a hard time remembering what I did in a file and with which person.

Here is an image of the little routine I use to store and show the notes I'm talking about.



It is in portuguese, but I think it is kind of self-explanatory? "Nota" means "Note"

there is another dialog where I write these notes and store them as xrecords.

the little pulldown menu is used to show slides of the corresponding notes.

I also have a "master file" where I put these notes and I have another routine to search these notes, with every note I store the directory of the file so I can open it from the "master file" I decided to do this because there are a lot of small projects I have a hard time finding and with these notes I can find them much more easily.

Ideally in my ignorance what I would like to do is

On the first version of the drawing.

When writing the first development note I can choose to set the entities as related to Note n 1.

When writing another note. I want to set the new entities as related to Note n 2, and if any entity is removed from Note n 1 set it as deleted.

Ideally I could then automatically revert the drawing to any revision.

But now I'm starting to understand how difficult It might be for me to do It.

I guess I'll try to make it as you guys are saying.




pBe

  • Bull Frog
  • Posts: 377
Re: Convert string to list?
« Reply #22 on: October 01, 2012, 11:09:55 AM »
....Ideally I could then automatically revert the drawing to any revision....

That would be neat eh?  :-)

Brick_top

  • Bull Frog
  • Posts: 218
Re: Convert string to list?
« Reply #23 on: October 01, 2012, 11:11:03 AM »
....Ideally I could then automatically revert the drawing to any revision....

That would be neat huh?  :-)

yeah that would be the idea... probably impossible for a guy like me  :-(

pBe

  • Bull Frog
  • Posts: 377
Re: Convert string to list?
« Reply #24 on: October 01, 2012, 11:17:48 AM »
Here's an idea, every succeeding revision would have its own unique layer identifier

N1_A_Anno_text, N1_A_Anno_Dim...

N2_A_Anno_text, N2_A_Anno_Dim...

Freeze the layer when you need to revert to a particular Rev number.


Brick_top

  • Bull Frog
  • Posts: 218
Re: Convert string to list?
« Reply #25 on: October 01, 2012, 11:21:39 AM »
Someone in another thread had a similar ideia using layerstates.

It might be more realistic that way.

Thanks a lot

CAB

  • Global Moderator
  • Seagull
  • Posts: 10395
Re: Convert string to list?
« Reply #26 on: October 01, 2012, 02:59:49 PM »
Better back up a step.  If this is from a (princ...) to the command line, those wrapping double-quotes DON'T ACTUALLY EXIST.  Moreover, the (entget...) function which generates this type of return doesn't return a string value, it returns a list of dotted pairs.

Context is everything - a little more information would lead to a nicely curved garden path, rather than a cloverleaf-intersection.   :wink:

Hi there.

Sorry for the lack of context. I'm using princ to a txt file and then I'm using the read-line function to put the content to a variable, and what I posted is the result of the read-line to a variable.

What I'm trying to do is to save some objects info in a txt file so I can later "rebuild" them when I want.
I was wondering, do you need to recreate it or compare it to an existing object or both?
I've reached the age where the happy hour is a nap. ()
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10395
Re: Convert string to list?
« Reply #27 on: October 01, 2012, 03:03:56 PM »
Reading more of your post I would think you would need to create a revision copy each time you added a note.

Or was your intent to selectively recreate selected objects pertaining to that note only & keep the current DWG?

I've reached the age where the happy hour is a nap. ()
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

chlh_jd

  • Guest
Re: Convert string to list?
« Reply #28 on: October 01, 2012, 04:31:15 PM »
Dose Landlord want to protect dwg not to be regain by this way (write protect dwg into txt file , and then rebuild dwg )?

Brick_top

  • Bull Frog
  • Posts: 218
Re: Convert string to list?
« Reply #29 on: October 02, 2012, 04:46:40 AM »
Reading more of your post I would think you would need to create a revision copy each time you added a note.

Or was your intent to selectively recreate selected objects pertaining to that note only & keep the current DWG?

Hi there

Yes my intent is to recreate only objects pertaining to that particular note. I'm not clear on it but there might be other problems with the idea, it could easily work with 2 notes but with more notes it might get complicated, I'll try to outline it below.

This is my ideia of how it could work?

With each Note I would have to save to xrecord which version is currently in use and which are the entities that it contains.

For Example:

Note 2 Is composed by entities number x to x from note 1 and entities number x to x from note 2. I guess I would also have to keep adding to every note which entities are to be deleted.
because I know which version is currently in use I know what entities are already drawn and which are to be deleted.


|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

When creating Notes and defining what entities belong to which version:

Note 1 - Would save a txt file for Note 1 with the numbered entities from Note 1 and save to xrecord that version from note 1 is in use and contains entities from number x to x from note 1.

Note 2 - For Note 2 I would compare every entity in the drawing against the ones that are saved in the txt from Note 1. I would then save to note 2 the new entities that are to be drawn. I will save to xrecord that Note 2 contains entities number x to x from Note 1 and number x to x from Note 2. I would also save the entities that are to be deleted from Note 1.

At this time I realize that acoording to which version currently in use and the one I intend to draw I must also save what entities are to be deleted according to the version currently in use.

Note 3 - Would have to compare the existing entities against Notes 1 and 2 to check which ones are to be drawn and deleted.

As of now I'm not thinking of any other problem that may arise... But I guess I'm sure there could be plenty.

« Last Edit: October 02, 2012, 04:54:06 AM by Brick_top »