Author Topic: Inunits - copy and paste fix?  (Read 387 times)

0 Members and 1 Guest are viewing this topic.

MickD

  • Gator
  • Posts: 3420
  • (x-in)->[process]->(y-out)
Inunits - copy and paste fix?
« on: May 10, 2020, 07:22:06 PM »
I have a client that has some blocks in a drawing that have been created using my software, the problem is I think he has copy/pasted some blocks from 1 drawing into another then started working again but the insunits were different for whatever reason.

These blocks are either inserted with a base point ('simple blocks') or created on the fly from geometry selected by the user (individual, 'complex blocks').
The problem happens when the user exports the block geometry to XML using my app, I think the geometry being read out for the 'complex' blocks is using the different insunits from the definition, not the insertion (reference), this means that while the drawing itself looks ok, the exported data is way out (meters to millimeters!).
The main problem is that the complex blocks all have an insertion/base point on 0,0,0 whereas the simple blocks have the insertion point given by the user when inserted so the scaling when being re-imported is way out.

My question then is:
Is there a simple, manual way to fix the insunits/scalefactor of the complex block definitions now? I don't think I can without re-defining each one and there is only one version of each block...

thanks!
Forth is like the Tao: it is a Way, and is realized when followed.
Its fragility is its strength; its simplicity is its direction - Michael Ham

Lao Tzu: “To attain knowledge, add things
every day; to obtain wisdom, remove things every day.”

MP

  • Seagull
  • Posts: 17662
  • Have thousands of dwgs to process? Contact me.
Re: Inunits - copy and paste fix?
« Reply #1 on: May 10, 2020, 08:18:55 PM »
I may be wrong but on the other hand ...

I’ve experienced an endless number of block scaling issues associated with the presence of entries hosted by the AEC_VARS (on IPad so can’t verify name but if that’s not it it’s dang close) dictionary. Long story short - the scaling problems are remedied if the AEC_VARS dictionary (in the Doc’s primary dic) is removed (you could cherry pick the actual entries but there’s no real benefit) from all blocks and all target drawings. If it exists anywhere the issues return. tl;dr: it’s like a {#$&*@+%} cancer.
Engineering Technologist • CAD Specialist • Programmer Analyst
Design • Drafting • Document Control • Automation.
cadanalyst@fastmail.comhttps://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

MP

  • Seagull
  • Posts: 17662
  • Have thousands of dwgs to process? Contact me.
Re: Inunits - copy and paste fix?
« Reply #2 on: May 10, 2020, 08:31:59 PM »
PS: It’s relatively easy to clean directories and directories of drawings via ObjectDBX. Coding blind on IPad, something like ...

(vl-catch-all-apply 'vla-delete
    (list
        (vl-catch-all-apply 'vla-item
            (list
                (vla-get-dictionaries doc)
                "AEC_VARS"
            )
        )
    )
)
Engineering Technologist • CAD Specialist • Programmer Analyst
Design • Drafting • Document Control • Automation.
cadanalyst@fastmail.comhttps://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

MickD

  • Gator
  • Posts: 3420
  • (x-in)->[process]->(y-out)
Re: Inunits - copy and paste fix?
« Reply #3 on: May 10, 2020, 08:48:53 PM »
Thanks Michael,
is the AEC_VARS an AutoCAD vertical thing? I ask as I think the problem started when we purged the drawing (Civil3d) but he had since copy/pasted into an old template and whatever else since then and had progressed too far to turn back...
I found a quick(er) solution for him but it involved exploding and recreating the blocks, luckily I have a properties dialog for the entities so he open it, explodes and recreates with the data in the dialog, better than nothing I guess.

I always planned on using groups instead of blocks and can't remember why I changed my mind....:)



Forth is like the Tao: it is a Way, and is realized when followed.
Its fragility is its strength; its simplicity is its direction - Michael Ham

Lao Tzu: “To attain knowledge, add things
every day; to obtain wisdom, remove things every day.”

dgorsman

  • Water Moccasin
  • Posts: 2422
Re: Inunits - copy and paste fix?
« Reply #4 on: May 10, 2020, 09:15:59 PM »
If it's the one created by the -DWGUNITS command-line command, then it's available in the vanilla one as well.
If you are going to fly by the seat of your pants, expect friction burns.

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

MP

  • Seagull
  • Posts: 17662
  • Have thousands of dwgs to process? Contact me.
Re: Inunits - copy and paste fix?
« Reply #5 on: May 10, 2020, 09:28:32 PM »
Hi Mick. I have always believed (no proof or documentation) it originated from Eaglepoint and was a half baked attempt at remedying a scaling issue that didn’t actually exist (some users simply didn’t understand how to use the existing scaling vars), creating one in the process - the dwgunits command. For whatever reason it was carried forward in Land Desktop / Land F/X and then found it’s way into the core product. Its artifacts - the AEC_VARS dictionary - sometimes exists, frequently does not. So you have scenarios where it’s in neither the host (A) or a block to be imported (B), in A but not in B, as well as in A and B. Frequently it’s presence in either A or B is that the insert command will effectively ignore your scaling instructions. Worse, not in a predictable, reliable manner. It was a huge recurring, time wasting problem at our company because well intentioned people would instruct others to run the dwgunits command to fix scaling woes, perpetuating the problem. {sigh} Nuking the dictionary in all docs and setting the unit vars directly remedied the problem for us.

Sorry if this doesn’t read well, have felt ill all day. :/
« Last Edit: May 10, 2020, 09:31:53 PM by MP »
Engineering Technologist • CAD Specialist • Programmer Analyst
Design • Drafting • Document Control • Automation.
cadanalyst@fastmail.comhttps://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

MickD

  • Gator
  • Posts: 3420
  • (x-in)->[process]->(y-out)
Re: Inunits - copy and paste fix?
« Reply #6 on: May 10, 2020, 09:38:50 PM »
If it's the one created by the -DWGUNITS command-line command, then it's available in the vanilla one as well.

thanks, I wouldn't know what they have done or when.
This is a very rare situation and I'd doubt it will happen again in a hurry, I always get a support call like this on Friday afternoon when a user is trying to crash out an overdue project and they do all sorts of things to cut corners etc not knowing what could possibly go wrong... :-o



Sorry if this doesn’t read well, have felt ill all day. :/

No, make sense thanks Michael, hope you feel better soon mate :)

Another issue is that they are opening a Civil3d drawing in Bricscad to use my tools, I did an audit and there were hundreds of errors, I'm sure this didn't help matters.
cheers.
Forth is like the Tao: it is a Way, and is realized when followed.
Its fragility is its strength; its simplicity is its direction - Michael Ham

Lao Tzu: “To attain knowledge, add things
every day; to obtain wisdom, remove things every day.”

MP

  • Seagull
  • Posts: 17662
  • Have thousands of dwgs to process? Contact me.
Re: Inunits - copy and paste fix?
« Reply #7 on: May 13, 2020, 01:02:17 AM »
Thanks for the well wishes Mick, feeling better today. Label me curious - woes reconciled?
Engineering Technologist • CAD Specialist • Programmer Analyst
Design • Drafting • Document Control • Automation.
cadanalyst@fastmail.comhttps://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

MickD

  • Gator
  • Posts: 3420
  • (x-in)->[process]->(y-out)
Re: Inunits - copy and paste fix?
« Reply #8 on: May 14, 2020, 07:07:44 PM »
Thanks for the well wishes Mick, feeling better today. Label me curious - woes reconciled?

Good to hear Michael, the user ended up restarting from a previous version with hopefully lesson learned I think.

I've never seen or heard of anything like this before and I think I will convert to using groups (unless someone has some experience on why this might not work??). The reason is end users are using drawings from all sorts of vertical app's and I just need a way to tag things with data without messing with their drawings.
Forth is like the Tao: it is a Way, and is realized when followed.
Its fragility is its strength; its simplicity is its direction - Michael Ham

Lao Tzu: “To attain knowledge, add things
every day; to obtain wisdom, remove things every day.”