What causes the "Schema Conflict when Loading a File" in Revit? - revit-api

When I open a Revit file, I get an error titled "Schema Conflict when Loading a File". The schema conflict is with my own schema. What could be different between the two schemas that could cause this error?
The full text of the error is:
Schema Conflict when Loading a File
The file being loaded is causing a conflict with existing data in the
model. What do you want to do?
The file contains data of schema "XYZ" (from "ABC"), which has the
same ID as a different schema already in memory. If the file is
loaded, the existing data will be erased from the model.

For End Users
If you are getting this error and did not develop a Revit add-in, forward this page to the developer. It will help them figure out what is going wrong.
For Developers
This error happens if the schema in the two projects are not exactly the same. If you are getting this error, something is different, and you need to dig deeper to figure out what it is.
In my case, the difference was the Application GUID I was using. For unrelated reasons, I changed this value in my project, not realizing it was going to cause problems for my schema.
Get the schema using Schema.Lookup and use the debugger to examine all the settings in it. Keep looking because you will eventually find something different.
Try using the The ExtensibleStorageUtility sample from the Revit SDK. It is helpful as written for getting a handle on what's going on with your schema. It is also a good platform to build from to dig deeper into their structure.

Related

JHipster: Generate an entity - how to?

When I
yo jhipster:entity MyEntity
the generated code is taking no notice of the MyEntity table definition in db-changelog-002.xml. For example, I am expecting the fields on the table to be listed in the generated html. Instead I am getting the 3 default fields for id, text and date.
The db-changelog-002.xml file has been generated by Liquibase using their instructions for generating it from a fresh start. It looks fine as far as I can tell. I put it into the \src\main\resources\config\liquibase directory, along with db-changelog-001.xml
How can I debug? Are my expectations incorrect?
If you are running in "hot reload" mode, then he Liquibase file should be generated, and the database schema should be updated. This the "normal" scenario, and it works surprinsigly well given how complex this task is.
However, the HTML page is not updated. No work has been done to implement this, but this would be a good idea, I'll have a look at it.

Lightweight Migration, how to set the version?

I ran into my first Core Data versioning problem - learn something every day!
Following instructions found here, I made a new version of the model, added the code for lightweight migration, and then went to set the active version…
Uhhh, where do you do that? The docs don't actually say, and other threads here talk about "click on the main file". WHAT "main file"?
The original xcdatamodel has no version number in it. Is that a problem? Is the Migration Manager still going to be able to figure this out?
All I did was add a field, this seems like a lot of work…
Core Data model files don't use version numbers. The files might include a number in their name, but that's for people to see, Core Data doesn't care about it. It uses entity hashes to compare models.
The "main file" is the .xcdatamodeld that contains all the versions (which have names ending in .xcdatamodel).
Select that then look in the file inspector pane on the right. It has a pop-up menu that you use to select the current version.

Entity Framework : How can I recreate tt records from and edmx file...does the lack of tt records cause could not find conceptual model error

I have been working with some database first entity framework development against an exisiting database and lots of stored procedures. When I was doing my development I would get tt files created and these were causing conflicts with the edmx file.... I forget the exact message but many of the generated classes where being found twice. When trying to solve this problem I found that if I deleted the tt files it clear the problem up... and did not appear to have any down side with this.
My code is working and all is good.
But now I have gotten far enough along that others are trying to use my code for the first time... They get the code out of the repository and I am finding that on every machine but my original development machine the code compiles fine, but when attempting to run I am getting an error of
"Could not fidn the concetual model for type xxxxx"... I know this is related to the Entity Framework and in reading I am beginning to think this is being caused by not having the tt records on the other machines....
I don't know why it works on my machine and not others....Is it because I deleted the tt records? If so How can I generate new tt records from the edmx file? I have looked and not found anything on how to correct my mistake....
The second question is how can I keep the tt records and the edmx file from conflicting? My memory is that the tt records would create file...but then when I would update the edmx file it would start creating conflicts .... like the edmx and the tt records would out of sync...and the tt records were not being updated when the edmx file was.
This is all still development code....I am now looking at trying to do code first EF...I had read about this, but didn't think I could take advantage of it as ALL of the business logic is stored in stored procedures so I was going the database first route.... But this is not working as there are tons of GETS each of which has a slightly different set of attributes.... From what I have seen the database first works, but I am getting a whole lot of different classes when what I really need is a base class...maybe with optional or nullable values... and in same cases a full hierachy of classes... so now I am just now starting to read up on code first EF with using an existing database (which I hope supports stored procedures).

a number of log4j config questions

I'm working on a project and we want to handle our logging using log4j. I am running into some issues that I am not able to easily resolve looking at the log4j docs, or other documentation online.
I get the basic idea of putting logging code throughout the codebase and then having the properties file assort the logged data into a hierarchy of appenders and how to write out to a file. That's fine. This basically allows me to create greppable log files in one hard coded folder, such as this:
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=example.log
But I have two basic questions: I want to have the log location be dynamic, such as:
log4j.appender.R.File={$processDir}/example.log
Also, every time the user runs this app, a folder will be created with the output files. I would like to have the log file be placed there, and I'm not sure how to accomplish that.
The other issue (although I think this will be a lot easier once the first issue is addressed...) is about creating a formatted log that does not necessarily reflect the process of how the app ran...for example, a title, followed by a list of all input files, a list of all output files, any warnings encountered.
I think for that I would create an object that implemented ObjectRenderer and write a doRender method that gave me the info I wanted.
Does that sound correct?
Thanks!
You can use variable with this syntax
log4j.appender.R.File=${processDir}/example.log
You must define the variables as system properties (es. -DprocessDir=...) or manually (after creating folder) with
System.setProperty("processDir",logDir);

Error The type or namespace name 'name of my tables' could not be found()are you missing a ussing directive or an assembly refrence?)

I get this error (The type or namespace name 'name of my tables' could not be found()are you missing a ussing directive or an assembly refrence?)) in Context.cs file when i compile my ASP.NET MVC2 Web Application. I follow these guide http://subsonicproject.com/docs/Setting_up_SubSonic_3.0 but i cant solve this problem.
I have seen this error after I made customizations to SQLServer.ttinclude to include only certain tables, but for which I forgot to make corresponding changes in ActiveRecord.tt. If you are just setting up and have made no modifications, probably you are not seeing the error for the same reason. But maybe try reloading your .tt and .ttinclude files from the SubSonic distribution so you are sure you didn't accidentally modify them (other than setting connection string etc.).

Resources