Author Topic: Reverse Ninja-Inserts  (Read 2273 times)

0 Members and 1 Guest are viewing this topic.

S.Langhammer

  • Guest
Reverse Ninja-Inserts
« on: February 18, 2014, 07:43:56 AM »
Wacky title, I know, but I think that discribes best, what I came across.

I converted a drawing  using the Lisp-Script I wrote and found some supposingly random positioned lines. First thought: "Ok, my misstake. I'll check the script."
I openes the .dwg file with BricsCAD to see what it's supposed to look like. In place of the few random lines were Inserts. Actual Inserts. I clicked them. They were there, in the Modelspace.
I thought I still made some kind of misstake with the way I handle Inserts, Blocks or LWPolylines in my script.
I opened the temporary textfile my script makes to check for the inserts. It didn't get any. So I checked the GetInsert function. It was just fine. Checked for GetLWPolylines and GETBlockRecords. Fine to. I made a DXF copy of the .dwg file and looked for the inserts in it with notepad++. I didn't find any of the missing block! I looked at the same dxf file in BricsCAD and they still where clearly there.
It's as if the Insert shows a picture, but hides it's code (that's why I called it reverse ninja).

I tryed inserting the Block again and I got an actual Insert, which I could read out with the script.

Does anyone have an Idea, how there can be Inserts, that don't show up as INSERT/AcDbBlockReference?

Is there a kind of new Insert type I don't know yet, that can refair to a block, without using it's block name?

Thanks in advance.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Reverse Ninja-Inserts
« Reply #1 on: February 18, 2014, 07:54:22 AM »
Can you post a drawing?
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.

S.Langhammer

  • Guest
Re: Reverse Ninja-Inserts
« Reply #2 on: February 18, 2014, 08:01:34 AM »
All I possibly could is to take a screen of the "Insert" and it's Properties, I hope that helps you. I can't publish the actual files  for legal reasons.

S.Langhammer

  • Guest
Re: Reverse Ninja-Inserts
« Reply #3 on: February 18, 2014, 08:47:30 AM »
I just took the entire object section out of the .dxf file. It didn't change. So I guess my problem's not coming form there.

S.Langhammer

  • Guest
Re: Reverse Ninja-Inserts
« Reply #4 on: February 19, 2014, 02:29:32 AM »
Ok by deleting entity by entity with notepad++ I found out, that  the Insert in the screenshot, is actually an anonymous Insert. The entity points to a block named *U12. I took another look at my GetInsert function and well I actually still had an error in it.

Now I'm curious though: How can an Insert, that clearly points to a block named *U12 show up with an other block name in the property window of the GUI?

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Reverse Ninja-Inserts
« Reply #5 on: February 19, 2014, 02:32:35 AM »

It's difficult to guess without seeing the drawing and/or the code you are using.

I prefer not to play guessing games.
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.

S.Langhammer

  • Guest
Re: Reverse Ninja-Inserts
« Reply #6 on: February 19, 2014, 02:35:50 AM »
I managed to fix the misstake I made.

In this line of code, I sent "blkName" to the simplify function, like  on all other calls I made. The misstake? There's no blkName in the function, where I use this line.

Code - Auto/Visual Lisp: [Select]
  1. (if(= T(contentCheck(Blk_ENameLstNstd entName)))(simplify entName))
  2.  

The question from my previous post is just curiosity now.

Jeff H

  • Needs a day job
  • Posts: 6151
Re: Reverse Ninja-Inserts
« Reply #7 on: February 19, 2014, 02:49:37 AM »
Ok by deleting entity by entity with notepad++ I found out, that  the Insert in the screenshot, is actually an anonymous Insert. The entity points to a block named *U12. I took another look at my GetInsert function and well I actually still had an error in it.

Now I'm curious though: How can an Insert, that clearly points to a block named *U12 show up with an other block name in the property window of the GUI?

I am lost but a BlockReference(Insert) is just a transformation as in scale, postion, rotation, etc...

So a dynamic block with references that has different visibility settings or entities that have been stretched independently of other references could not be a transformation of the same block. It would contradict what a Block is.

Blocks are static and should not vary per reference other than scale, rotation, postion, etc...

So there is nothing really dynamic about dynamic blocks, for each different representation it creates a new definition and a * in front of name keeps it from showing up in UI as in Block Edit dialog or insert dialog.

Maybe BlockDefinitionBuilder would have been better but does not sound as cool.
When you edit a dynamic block it creates another block definition and uses dynamic name in GUI but it actually transforming *U1 or whatever.

Write code that strips * from name of blocks except model space and you will see all the different anonymous blocks and will see dimensions are blocks named  *D1.....DN, Tables are blocks *T1....
« Last Edit: February 19, 2014, 02:56:52 AM by Jeff H »

S.Langhammer

  • Guest
Re: Reverse Ninja-Inserts
« Reply #8 on: February 19, 2014, 02:55:32 AM »
Thanks for the input Jeff.

One of the tiny obstacles I have to face is, that I've never actually made a real CAD drawing, I'm just supposed to convert them. With a lot of help from the people on here, I actually managed so far.

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Reverse Ninja-Inserts
« Reply #9 on: February 19, 2014, 12:56:34 PM »
I feel like this thread was made specifically for ronjonp.
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

Matt__W

  • Seagull
  • Posts: 12955
  • I like my water diluted.
Re: Reverse Ninja-Inserts
« Reply #10 on: February 19, 2014, 01:42:13 PM »
I feel like this thread was made specifically for ronjonp.
:-D
Autodesk Expert Elite
Revit Subject Matter Expert (SME)
Owner/FAA sUAS Pilot @ http://skyviz.io